PPL Flashcards
In the expression x = 7 + 3 * 6, which operation is performed first?
A. Addition C. Subtraction
B. Multiplication D. Division
B. Multiplication
Who is credited with designing the first widely known compiler?
a) Alick E. Glennie c) John Backus
b) Grace Hopper d) Dennis Ritchie
B. GRACE HOPPER
What kind of programming uses logical deduction rather than sequential steps?
A. Object-Oriented Programming
B. Imperative Programming
C. Functional Programming
D. Logic Programming
D. 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
D. DEBUGGING MODE
Which paradigm organizes computation around variables and stepwise control of data manipulation?
a) Functional c) Imperative
b) Logic d) Declarative
C. IMPERATIVE
What is the purpose of a variable in programming?**
A. It stores data temporarily in memory
B. It performs mathematical calculations
C. It controls the flow of the program
D. It only stores integers
A. 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
A. SIMULA
Functional programming is based on which mathematical concept?
a) Boolean algebra c) Logic predicates
b) Lambda calculus d) Stored program concept
B. 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
C. 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
A. 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
B. 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
C. ABSTRACTION
In which language paradigm are “classes” and “objects” fundamental concepts?
A. Imperative C. Object-Oriented
B. Functional D. Declarative
C. 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
B. Translates assembly language into machine code
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. 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
B. 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
C. 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) Object-oriented
c) Imperative
d) Functional
a) Declarative
Which language was a major influence on the development of structured programming?
a) C++ c) Lisp
b) ALGOL d) Smalltalk
b) ALGOL
Which programming language feature is primarily responsible for improving reliability by preventing programs from crashing due to unexpected circumstances?
a) Expressiveness
b) Exception handling
c) Syntax design
d) Data structures
b) Exception handling
Who invented the binary system and calculus?
A. Alan Turing
B. Gottfried Wilhelm Leibniz
C. Alonzo Church
D. Abu Ja’far Muhammad ibn Musa
B. Gottfried Wilhelm Leibniz
What is a key drawback of highly expressive programming languages?
a) Reduced readability
b) Less reliability
c) Weaker data types
d) Limited exception handling
a) Reduced readability
Which is NOT a characteristic of machine language?
A. Translation-free
B. Error-prone
C. Machine dependent
D. High-level abstraction
D. High-level abstraction
Prolog was originally designed for which application?
a) Object-oriented programming
b) Artificial intelligence
c) Mathematical calculations
d) System implementation
b) Artificial intelligence
Which of the following is a primitive type?
A) Array
B) int
C) Class
D) Structure
B) int
Which data type is most likely a composite type?
A) boolean
B) float
C) Array
D) int
C) Array
What is a characteristic of primitive types?
A) Complex structure
B) Defined by the user
C) Fixed size
D) Customizable size
C) Fixed size
What is a major disadvantage of dynamic typing?
A) Errors may only be detected at runtime
B) Reduced flexibility
C) Increased verbosity
D) None of the above
A) Errors may only be detected at runtime
Which type of typing performs type checking at compile time?
A) Dynamic typing
B) Static typing
C) Weak typing
D) None of the above
B) Static typing
Non-primitive types are also known as:
A) Simple types
B) Complex types
C) Immutable types
D) Built-in types
B) Complex types
In weakly typed languages, implicit type conversion is also called:
A) Type coercion
B) Type annotation
C) Type casting
D) Type deduction
A) Type coercion
Which of the following is not a composite type?
A) Array
B) int
C) List
D) Tuple
B) int
What is a common issue with using pointers?
A) Memory leaks
B) Faster code execution
C) Reduced memory usage
D) None of the above
A) Memory leaks
A scalar type is best defined as:
A) A data type that holds a single value
B) A data type with multiple elements
C) A non-primitive type
D) A complex structure
A) A data type that holds a single value