CSE 240 MIDTERM QUESTIONS & ANSWERS
Stored Program Concept (von Neumann machine) is one of the most fundamental
concepts in computer science. What programming paradigm most closely follows this
concept? - Answers :imperative
A set of basic principles, concepts, and methods for how a computation or algorithm is
expressed - Answers :paradigm
The programming paradigm that expresses computation by fully-specified and fully-
controlled manipulation of named data in a stepwise function - Answers :imperative
Another term for the imperative paradigm - Answers :procedural
The programming paradigm that is basically the same as the imperative paradigm
except that related variables and operations on variables are organized into classes of
objects - Answers :object-oriented
The programming paradigm that expresses computation in terms of mathematical
functions - Answers :functional
Another term for the functional paradigm - Answers :applicative
The programming paradigm that expresses computation in terms of logic predicates -
Answers :logic
Another term for the logic paradigm - Answers :declarative
If you teach someone to make a pizza, you are in fact teaching (functional, imperative)
programming. - Answers :imperative
If you teach someone to order a pizza from a restaurant, you are in fact teaching
(functional, imperative) programming. - Answers :functional
Because of hardware constraints, early programming languages emphasized _____. -
Answers :readability
The main idea of structured programming is to A) increase the types of control
structures, B) make programs execute faster, C) reduce the types of control structures,
D) use BNF to define the syntactic structure. - Answers :C
A meta language that can be used to define the lexical and syntactic structures of
another language - Answers :Backus-Naus Form
Which programming language allows the mixed use of data types? (Ada, C, Java, All of
them) - Answers :C
, In the layers of programming structure, which layer performs type checking? - Answers
:contextual
Which programming structure defines the program semantics before dynamic
execution? - Answers :contextual
Another term for contextual structure - Answers :static semantics
Which programming structure describes the meaning of a program during the
execution? - Answers :semantic structure
Which programming structure defines the grammar of forming sentences or statements
using the lexical units? - Answers :syntactic structure
Which programming structure defines the vocabulary of a language? - Answers :lexical
structure
Interpretation is not efficient if A) multi-module programming is used, B) the difference
between source and destination is small, C) the source program is small, or D) the
source program is written in an assembly language. - Answers :A
A machine language with sophisticated use of mnemonics - Answers :assembly
language
The direct execution of one statement at a time sequentially by the interpreter - Answers
:interpretation
First translates all the statements of a program into assembly language code or
machine code before any statement is executed - Answers :compilation
(Inclining, Macro) is a suggestion to the compiler, while (inlining, macro) will be
enforced. - Answers :Inlining, macro
The phase prior to the code translation to the assembly or machine code - Answers
:preprocessing
Macros processing takes place during which phase? - Answers :preprocessing
Assume a program requires 20 lines of machine code and will be called 10 times in the
main program. You can choose to implement it using a function definition or a macro
definition. Compared with the function definition, macro definition will lead the compiler
to generate, for the entire program, (longer, shorter, the same length of) machine code
and (longer, shorter, the same) execution time. - Answers :longer, shorter
Stored Program Concept (von Neumann machine) is one of the most fundamental
concepts in computer science. What programming paradigm most closely follows this
concept? - Answers :imperative
A set of basic principles, concepts, and methods for how a computation or algorithm is
expressed - Answers :paradigm
The programming paradigm that expresses computation by fully-specified and fully-
controlled manipulation of named data in a stepwise function - Answers :imperative
Another term for the imperative paradigm - Answers :procedural
The programming paradigm that is basically the same as the imperative paradigm
except that related variables and operations on variables are organized into classes of
objects - Answers :object-oriented
The programming paradigm that expresses computation in terms of mathematical
functions - Answers :functional
Another term for the functional paradigm - Answers :applicative
The programming paradigm that expresses computation in terms of logic predicates -
Answers :logic
Another term for the logic paradigm - Answers :declarative
If you teach someone to make a pizza, you are in fact teaching (functional, imperative)
programming. - Answers :imperative
If you teach someone to order a pizza from a restaurant, you are in fact teaching
(functional, imperative) programming. - Answers :functional
Because of hardware constraints, early programming languages emphasized _____. -
Answers :readability
The main idea of structured programming is to A) increase the types of control
structures, B) make programs execute faster, C) reduce the types of control structures,
D) use BNF to define the syntactic structure. - Answers :C
A meta language that can be used to define the lexical and syntactic structures of
another language - Answers :Backus-Naus Form
Which programming language allows the mixed use of data types? (Ada, C, Java, All of
them) - Answers :C
, In the layers of programming structure, which layer performs type checking? - Answers
:contextual
Which programming structure defines the program semantics before dynamic
execution? - Answers :contextual
Another term for contextual structure - Answers :static semantics
Which programming structure describes the meaning of a program during the
execution? - Answers :semantic structure
Which programming structure defines the grammar of forming sentences or statements
using the lexical units? - Answers :syntactic structure
Which programming structure defines the vocabulary of a language? - Answers :lexical
structure
Interpretation is not efficient if A) multi-module programming is used, B) the difference
between source and destination is small, C) the source program is small, or D) the
source program is written in an assembly language. - Answers :A
A machine language with sophisticated use of mnemonics - Answers :assembly
language
The direct execution of one statement at a time sequentially by the interpreter - Answers
:interpretation
First translates all the statements of a program into assembly language code or
machine code before any statement is executed - Answers :compilation
(Inclining, Macro) is a suggestion to the compiler, while (inlining, macro) will be
enforced. - Answers :Inlining, macro
The phase prior to the code translation to the assembly or machine code - Answers
:preprocessing
Macros processing takes place during which phase? - Answers :preprocessing
Assume a program requires 20 lines of machine code and will be called 10 times in the
main program. You can choose to implement it using a function definition or a macro
definition. Compared with the function definition, macro definition will lead the compiler
to generate, for the entire program, (longer, shorter, the same length of) machine code
and (longer, shorter, the same) execution time. - Answers :longer, shorter