Science Quiz / CPS 506 Chapter 6

Random Science Quiz

Can you name the answers to CPS 506 questions in chapter 6?

 Plays Quiz not verified by Sporcle

Forced Order
Score 0/46 Timer 20:00
Fundamentals of Subprograms
Each subprogram has __________ 
Calling Program is _______ during execution of called subprogram 
Control always returns to ______ when subprogram's execution terminates 
Two kinds of Subprograms
Subprogram definition describes:
Random Question
In this language, Function definitions are executable, In all other languages, they are non-executable 
Parts of a subprogram (Definitions)
First part of definition and includes: Name, Kind of Subprogram, Formal parameters 
Second part includes: Number, Order, Types of its parameters 
Third part includes: Parameter Profile, return type 
More Basic Definitions
Dummy variable Listed in the subprogram header and used in subprogram 
Represents a value or address used in the subprogram call statement 
Parameter Correspondence
1st formal parameter bound to 1st actual parameter, 2nd to 2nd... Safe and effective, All languages support this method of parameter binding 
Name of formal parameter to which an actual paremeter is to be bound is specified with actual parameter. Adv: Parameters can appear in any order. Disadv: User must know formal parameter names 
Stack-Dynamic Local Variables
Bound to storage when subprogram ______ 
Unbounded from storage when ________ 
Adv. #1: Supports this method of solving problems 
Adv. #2: Storage for locals is ______ with those of inactive subprograms 
Advantages of stack-static are _______ of stack dynamic 
Semantic Models of Parameter Passing
No change is returned. Some parameters are just passed to the subprogram. Implemented by copying or trasmitting an access path. Caller pass to callee 
No parameter is passed, just result return to caller. Requires extra storage location and copy operation. Calle pass to caller 
Pass an access path. Also known as pass by sharing. Adv: efficient (no copying and no duplicated storage) Disadv. slower accesses and potential for collisions 
By textual substitution. Formals are bound to an access method at the tome of the call but actual binding to a value or address takes palce at the time of a reference or assignament. Allows flexibility in late binding 
Parameter passing: C
Default method of parameter passing 
Pass by reference achieved by using _____ as parameters 
Parameter passing: Java
Default method of parameter passing 
Object parameters passed by _______ 
Parameter passing: Ada
Default mode 
Type checking parameters
Name a language with no type checking parameters 
Name a language that requires type checking 
Name a language that does not require type checking 
Parameters that are subprogram names
Environment of the call statement that enacts passed subprogram. Natural for dynamic scoped languages 
Environment of the definition of the passed subprogram 
Environment of the call statement that passed the subprogram 
Overloaded subprograms
Overloaded subprograms have same ____ as another subprogram in the same referencing environment 
In Ada, this is used in overloaded function to disambiguate calls and allow 2 functions to have same parameters 
Generic subprograms
A generic or polymorphic subprogram takes parameters of different ____ on different activations 
In Ada, this is how a generic subprogram is decalred 
Design issues for functions
C allows return types of everything except these two which are handled by pointer type return values 
Ada subprograms can return any type except: 
Java and C# methods can return any type except 
Python and ruby can return any type including methods and classes: True or False 
A coroutine is a subprogram that has ________ and controls them itself. This is supported in Lua 
Caller and called coroutines are on a more equal basis 
A co-routine call is named this 

You're not logged in!

Compare scores with friends on all Sporcle quizzes.
Join for Free
Log In

You Might Also Like...

Show Comments


Created Apr 14, 2010SourceReportNominate

Top Quizzes Today

Score Distribution

Your Account Isn't Verified!

In order to create a playlist on Sporcle, you need to verify the email address you used during registration. Go to your Sporcle Settings to finish the process.

Report this User

Report this user for behavior that violates our Community Guidelines.