CS 3003 Midterm

0.0(0)
Studied by 1 person
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/73

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:28 PM on 6/25/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

74 Terms

1
New cards

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.

2
New cards

4

Static Lifetime

Stack Dynamic Lifetime

Explicit Heap Dynamic Lifetime

Implicit Heap Dynamic Lifetime

How many lifetimes are there according to the author?

3
New cards

Imperative

The von Neumann architecture had the biggest impact on which of the four programming paradigms?

4
New cards

programming language

a system of communicating computational ideas between people and computing machines

5
New cards

low-level language

the language is dependent on the machine

6
New cards

high-level language

the language is independent of the machine

7
New cards

syntax

the rules that define a structurally valid program

8
New cards

names

ways to identify entities

9
New cards

types

the rules by which an expression can properly interact with the language

10
New cards

semantics

the effect of each statement's execution on program operation

11
New cards

Imperative programming language

Languages based on giving the computer commands or procedures to follow.

examples: assignment operators, functions/procedures, selection statements, and loops

12
New cards

object-oriented programming

designing a program by discovering objects, their properties, and their relationships

Examples: sending messages between objects, messages causing an action

13
New cards

Functional Programming

A programming paradigm that uses functions to create programs.

Functions are first class objects, relies on recursion, and conditional statements. No loops

14
New cards

Logic Programming

declares what outcome the program should accomplish

Tell the computer what and not how

15
New cards

Language readability

how close is it to human speech? how easy/hard is it to understand without compiling?

16
New cards

Language writability

How expressive is a language for solving problems in a particular context?

17
New cards

Language Reliability

How easy/hard is it to write correct programs?

18
New cards

Simplicity

concise, feature multiplicity, etc.

19
New cards

Orthogonality

How easy/hard is it to combine features in regular ways? (a type of measure when comparing programming languages)

20
New cards

Aliasing

2 or more different names for the same memory location

21
New cards

Types

the valid values for a variable that can be used to determine a programs correctness

22
New cards

assignment statement

used to change the program state, plays a central role in imperative and object-oriented programming

23
New cards

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.

24
New cards

operation steps in Von Neumann Architecture

1. Fetch

2. Decode

3. Execute

25
New cards

Scientific computing

What was the first programming domain?

26
New cards

increases

As the amount of orthogonality in a programming language's design decreases, the number of exceptional semantic situations

27
New cards

Object Oriented

________________ programming languages are designed to support software development built on data abstractions.

28
New cards

Writability and readability

Which of the following are language evaluation criteria according to Sebesta? (Check all that apply)

29
New cards

state

Programs written in a (pure) functional programming language do not have ________________; programs written in imperative and object-oriented languages do.

30
New cards

BNF

Algol was the first language whose syntax was formally specified. In what format was the syntax of Algol written?

31
New cards

teaching programming

Pascal was written as a language for doing what?

32
New cards

Extenstion

Which of the following is NOT a property of a variable?

extension

scope

lifetime

type

name

33
New cards

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

34
New cards

Type Inference

_____________________ is the process of using the context to determine the type of a variable.

Type binding

Type inference

Type checking

Type elaboration

35
New cards

Implicit heap-dynamic variables

allocation and deallocation caused by assignment statements

36
New cards

Explicit heap-dynamic variables

Variables that are nameless (abstract) memory cells allocated and deallocated by explicit run-time instructions written by the programmer.

37
New cards

stack-dynamic variables

Variables whose storage bindings are created when their declaration statements are elaborated, but whose types are statically bound.

38
New cards

static variable

the variable is allocated storage for the entire duration of program execution.

39
New cards

Lifetime

The ______________________ is the time during which a variable is bound to storage.

40
New cards

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.

41
New cards

Stack Dynamic

A(n) ____________________ variable's storage is bound when its declaration is elaborated.

explicit heap dynamic

implicit heap dynamic

stack dynamic

static

42
New cards

Binding

A(n) _____________________ is an association between an attribute (e.g., type, scope, address) and an entity (e.g., variable, symbol).

43
New cards

Protocol

The ___________ of a subprogram is its parameter profile and its return type (if it is a function).

declaration

header

protocol

definition

44
New cards

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

45
New cards

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

46
New cards

Procedure

A(n) ______________________ is a subprogram that does not return a value.

abstraction

function

procedure

coroutine

47
New cards

Yields

A coroutine cooperates with its caller -- the caller of a coroutine is suspended until the coroutine _______________.

crashes

completes

yields

calls another function

48
New cards

Process

Subprograms are __________________ abstractions.

executable

process

data

parametric

49
New cards

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

50
New cards

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.

51
New cards

False

In a weakly typed language, all type errors are detected.

True

False

52
New cards

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.

53
New cards

Coercion

A(n) ________________ is an implicit conversion between two types that are equivalent.

coercion

interchange

cast

transformation

54
New cards

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

55
New cards

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

56
New cards

Parameter Profile

The _______________________________ of a subprogram contains the number, order and type of its formal parameters.

definition

header

parameter profile

protocol

57
New cards

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.

58
New cards

Function

A(n) _________________ is a subprogram that does return a value.

procedure

function

abstraction

coroutine

59
New cards

Primitive

A(n) _______________________ type holds values that are atomic (indivisible) from the programmer's perspective.

simple

ad-hoc

primitive

aggregate

60
New cards

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.

61
New cards

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

62
New cards

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

63
New cards

Referential Transparency

A language with _________________________________ (two words) is one without side effects.

64
New cards

Formal

The _____________________ parameters of a subprogram are declared in the subprogram header.

65
New cards

Parameter Profile

The _______________________________ (two words) of a subprogram contains the number, order and type of its formal parameters.

66
New cards

Procedure

A(n) ______________________ is a subprogram that does not return a value.

67
New cards

Process

Subprograms are __________________ abstractions.

68
New cards

Syntax

The __________________ of a language are the rules for constructing valid programs

69
New cards

Programming Paradigm

A(n) ____________ (two words) is a pattern of problem-solving thought that underlies a particular genre of programs and languages.

70
New cards

Locally

A variable is _________ scoped to a unit or block of a program if it is declared there.

71
New cards

Stack frame

The data structure that holds all the information about an active function is known as the ______________ (two words).

72
New cards

static

A(n) ___________________ variable is bound to storage before program execution begins and retains the same binding throughout program execution.

73
New cards

Stack dynamic lifetimes

Variables with ________________ are allocated in the stack frame.

infinite lifetimes

stack-dynamic lifetimes

static lifetimes

heap-dynamic lifetimes

74
New cards

Speed of executable code

What was the primary goal of the earliest version of Fortran?

Speed of executable code

Writability

Readability

Programmer's Productivity