PPL CS200 Flashcards
In the expression x = 7 + 3 * 6, which operation is performed first?
A. Addition C. Subtraction
B. Multiplication D. Division
Multiplication
Who is credited with designing the first widely known compiler?
a) Alick E. Glennie c) John Backus
b) Grace Hopper d) Dennis Ritchie
Grace Hopper
What kind of programming uses logical deduction rather than sequential steps?
A. Object-Oriented Programming
B. Functional Programming
C. Imperative Programming
D. Logic Programming
Logic Programming
Which of the following is NOT considered a feature of a programming language?
a) Orthogonality c) Type equivalence
b) Control structures d) Debugging mode
Debugging mode
Which paradigm organizes computation around variables and stepwise control of data manipulation?
a) Functional c) Imperative
b) Logic d) Declarative
Imperative
What is the purpose of a variable in programming?**
A. It stores data temporarily in memory
B. It controls the flow of the program
C. It performs mathematical calculations
D. It only stores integers
It stores data temporarily in memory
Which of the following languages introduced the concept of object-oriented programming?
a) Simula c) Fortran
b) Pascal d) Prolog
Simula
Functional programming is based on which mathematical concept?
a) Boolean algebra
b) Lambda calculus
c) Logic predicates
d) Stored program concept
Lambda calculus
What type of error occurs if you try to divide an integer by zero in most programming languages?**
A. Syntax error C. Runtime error
B. Compilation error D. Logical error
Runtime error
Which of the following is a primary aspect of program performance influenced by language features?
a) Expressiveness c) Aliasing
b) Reusability d) Assembly language compatibility
Expressiveness
What is a common disadvantage of using a compiler over an interpreter?**
A. The compiled code is not portable
B. You must recompile the code after making changes
C. It translates code line by line, which is slower
D. Errors are displayed one at a time during execution
. You must recompile the code after making changes
Which feature of programming languages supports reuse of code and improves readability and writeability?
a) Control structures c) Abstraction
b) Syntax design d) Type checking
Abstraction
In which language paradigm are “classes” and “objects” fundamental concepts?
A. Imperative C. Object-Oriented
B. Functional D. Declarative
Object-Oriented
What does an assembler do?
A. Translates machine code into assembly
B. Translates assembly language into machine code
C. Interprets high-level languages
D. Debugs programs
Translates assembly language into machine code
Which of the following is a typical functional programming language?
a) Fortran c) Lisp
b) Java d) Prolog
Lisp
. What does P vs NP in programming refer to?
A. A classification of problems based on difficulty in algorithmic solution
B. A programming language comparison
C. A discussion of hardware limitations
D. The development of new software
A classification of problems based on difficulty in algorithmic solution
What is a key difference between a compiler and an interpreter?
A. A compiler runs code line by line
B. An interpreter translates and runs code line by line, while a compiler translates the whole code at once
C. A compiler executes the code immediately
D. An interpreter saves the object code for later use
An interpreter translates and runs code line by line, while a compiler translates the whole code at once
When is a while loop typically used?**
A. When you know exactly how many times the code block will execute
B. When there are no conditions to check
C. When you do not know the number of iterations or details of the condition
D. When iterating through a list
When you do not know the number of iterations or details of the condition
The paradigm that expresses computation in terms of logic predicates is known as:
a) Declarative
b) Imperative
c) Object-oriented
d) Functional
Declarative
Which language was a major influence on the development of structured programming?
a) C++ c) Lisp
b) ALGOL d) Smalltalk
ALGOL