1/73
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Subprogram has a single entry.
Caller is suspended until completion of the subprogram.
Program execution returns to the caller upon completion of the subprogram's execution.
Which of the following are characteristics of a subprogram? (Check all that apply)
Subprogram has a single entry.
It cannot change the value of global variables.
Caller is suspended until completion of the subprogram.
Program execution returns to the caller upon completion of the subprogram's execution.
4
Static Lifetime
Stack Dynamic Lifetime
Explicit Heap Dynamic Lifetime
Implicit Heap Dynamic Lifetime
How many lifetimes are there according to the author?
Imperative
The von Neumann architecture had the biggest impact on which of the four programming paradigms?
programming language
a system of communicating computational ideas between people and computing machines
low-level language
the language is dependent on the machine
high-level language
the language is independent of the machine
syntax
the rules that define a structurally valid program
names
ways to identify entities
types
the rules by which an expression can properly interact with the language
semantics
the effect of each statement's execution on program operation
Imperative programming language
Languages based on giving the computer commands or procedures to follow.
examples: assignment operators, functions/procedures, selection statements, and loops
object-oriented programming
designing a program by discovering objects, their properties, and their relationships
Examples: sending messages between objects, messages causing an action
Functional Programming
A programming paradigm that uses functions to create programs.
Functions are first class objects, relies on recursion, and conditional statements. No loops
Logic Programming
declares what outcome the program should accomplish
Tell the computer what and not how
Language readability
how close is it to human speech? how easy/hard is it to understand without compiling?
Language writability
How expressive is a language for solving problems in a particular context?
Language Reliability
How easy/hard is it to write correct programs?
Simplicity
concise, feature multiplicity, etc.
Orthogonality
How easy/hard is it to combine features in regular ways? (a type of measure when comparing programming languages)
Aliasing
2 or more different names for the same memory location
Types
the valid values for a variable that can be used to determine a programs correctness
assignment statement
used to change the program state, plays a central role in imperative and object-oriented programming
selection-statement
allows us to choose which statement will be executed next based on the evaluation of a boolean condition. Also known as a conditional statement.
operation steps in Von Neumann Architecture
1. Fetch
2. Decode
3. Execute
Scientific computing
What was the first programming domain?
increases
As the amount of orthogonality in a programming language's design decreases, the number of exceptional semantic situations
Object Oriented
________________ programming languages are designed to support software development built on data abstractions.
Writability and readability
Which of the following are language evaluation criteria according to Sebesta? (Check all that apply)
state
Programs written in a (pure) functional programming language do not have ________________; programs written in imperative and object-oriented languages do.
BNF
Algol was the first language whose syntax was formally specified. In what format was the syntax of Algol written?
teaching programming
Pascal was written as a language for doing what?
Extenstion
Which of the following is NOT a property of a variable?
extension
scope
lifetime
type
name
Program Design Time
Which of the following is NOT a valid binding time?
program compile time
program design time
program runtime
language design time
program load time
Type Inference
_____________________ is the process of using the context to determine the type of a variable.
Type binding
Type inference
Type checking
Type elaboration
Implicit heap-dynamic variables
allocation and deallocation caused by assignment statements
Explicit heap-dynamic variables
Variables that are nameless (abstract) memory cells allocated and deallocated by explicit run-time instructions written by the programmer.
stack-dynamic variables
Variables whose storage bindings are created when their declaration statements are elaborated, but whose types are statically bound.
static variable
the variable is allocated storage for the entire duration of program execution.
Lifetime
The ______________________ is the time during which a variable is bound to storage.
No runtime allocation or deallocation of storage space
The variable's value can be directly accessed
Which of the following are benefits of variables with a static lifetime? Check all that apply.
No runtime allocation or deallocation of storage space.
Support for recursion.
The variable's value can be directly accessed.
Stack Dynamic
A(n) ____________________ variable's storage is bound when its declaration is elaborated.
explicit heap dynamic
implicit heap dynamic
stack dynamic
static
Binding
A(n) _____________________ is an association between an attribute (e.g., type, scope, address) and an entity (e.g., variable, symbol).
Protocol
The ___________ of a subprogram is its parameter profile and its return type (if it is a function).
declaration
header
protocol
definition
Pure
A function that neither modifies variables outside itself nor modifies its parameters in a way that is visible to the caller is known as a(n) ____________ function.
pure
accurate
limited
perfect
Ad-hoc
In _________________________ polymorphism, the semantics of the function may change depending on the type of a subprogram's parameters.
parametric
functional
object-oriented
ad-hoc
Procedure
A(n) ______________________ is a subprogram that does not return a value.
abstraction
function
procedure
coroutine
Yields
A coroutine cooperates with its caller -- the caller of a coroutine is suspended until the coroutine _______________.
crashes
completes
yields
calls another function
Process
Subprograms are __________________ abstractions.
executable
process
data
parametric
homogeneous
An array is a(n) ________________ aggregate data type in which an individual element is accessed by its position in the aggregate.
flexible
heterogeneous
useful
homogeneous
Hold information about an active function
The stack frame is the data structure used to ... (choose one)
track the types of variables in a program.
hold information about an active function.
monitor program execution for the operating system.
hold information about a completed function.
False
In a weakly typed language, all type errors are detected.
True
False
All of the above
Select all the statements that apply to a type system.
Define the valid types in a language.
Specify if/how types are compatible.
Specify how to compose types into new types.
Specify if/how types are equivalent.
Coercion
A(n) ________________ is an implicit conversion between two types that are equivalent.
coercion
interchange
cast
transformation
Product
Records (or structs) are also known as ________________ types because variables of this type can hold all the value of all combinations of the values of its included types.
quantitative
product
divisator
sum
Sum
Unions are also known as _________________ types because variables of this type can hold all the values of any of its included types.
product
sum
divisator
quantitative
Parameter Profile
The _______________________________ of a subprogram contains the number, order and type of its formal parameters.
definition
header
parameter profile
protocol
A programmer's code is more readable.
A programmer can use the functionality without knowing how it is implemented.
A programmer who wants to use the abstracted functionality needs to know only the function's interface.
Select all the benefits of procedural abstraction.
A programmer's code is more readable.
A programmer can use the functionality without knowing how it is implemented.
A programmer who wants to use the abstracted functionality needs to know only the function's interface.
A program that uses procedural abstraction is faster at runtime.
Function
A(n) _________________ is a subprogram that does return a value.
procedure
function
abstraction
coroutine
Primitive
A(n) _______________________ type holds values that are atomic (indivisible) from the programmer's perspective.
simple
ad-hoc
primitive
aggregate
Imperative
In a(n) ____________________________________ programming language, the assignment statement (or expression) is akin to the pipeline between the memory and the processor in the Von Neumann Model.
Implicit Convention
Explicit
Implicit Inference
In a statically typed programming language, all the variables must have a type at the time of compilation. Please select all the different ways that a variable can be given a type at the time of compilation. (Again, please check all the ways!)
Implicit - Convention
Explicit
Implicit - Inference
Abstraction
Assumed
Scoped
Static
Stack Dynamic
Implicit Heap Dynamic
Explicit Heap Dynamic
Which of the following are the valid lifetimes for a variable. Select all
Static
Classic
Stack dynamic
Runtime
Implicit heap dynamic
Modern
Explicit heap dynamic
Referential Transparency
A language with _________________________________ (two words) is one without side effects.
Formal
The _____________________ parameters of a subprogram are declared in the subprogram header.
Parameter Profile
The _______________________________ (two words) of a subprogram contains the number, order and type of its formal parameters.
Procedure
A(n) ______________________ is a subprogram that does not return a value.
Process
Subprograms are __________________ abstractions.
Syntax
The __________________ of a language are the rules for constructing valid programs
Programming Paradigm
A(n) ____________ (two words) is a pattern of problem-solving thought that underlies a particular genre of programs and languages.
Locally
A variable is _________ scoped to a unit or block of a program if it is declared there.
Stack frame
The data structure that holds all the information about an active function is known as the ______________ (two words).
static
A(n) ___________________ variable is bound to storage before program execution begins and retains the same binding throughout program execution.
Stack dynamic lifetimes
Variables with ________________ are allocated in the stack frame.
infinite lifetimes
stack-dynamic lifetimes
static lifetimes
heap-dynamic lifetimes
Speed of executable code
What was the primary goal of the earliest version of Fortran?
Speed of executable code
Writability
Readability
Programmer's Productivity