PPL CS200 Flashcards

1
Q

In the expression x = 7 + 3 * 6, which operation is performed first?
A. Addition C. Subtraction
B. Multiplication D. Division

A

Multiplication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Who is credited with designing the first widely known compiler?
a) Alick E. Glennie c) John Backus
b) Grace Hopper d) Dennis Ritchie

A

Grace Hopper

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What kind of programming uses logical deduction rather than sequential steps?
A. Object-Oriented Programming
B. Functional Programming
C. Imperative Programming
D. Logic Programming

A

Logic Programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following is NOT considered a feature of a programming language?
a) Orthogonality c) Type equivalence
b) Control structures d) Debugging mode

A

Debugging mode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which paradigm organizes computation around variables and stepwise control of data manipulation?
a) Functional c) Imperative
b) Logic d) Declarative

A

Imperative

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

A

It stores data temporarily in memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following languages introduced the concept of object-oriented programming?
a) Simula c) Fortran
b) Pascal d) Prolog

A

Simula

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Functional programming is based on which mathematical concept?
a) Boolean algebra
b) Lambda calculus
c) Logic predicates
d) Stored program concept

A

Lambda calculus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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

A

Runtime error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

. You must recompile the code after making changes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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

A

Abstraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In which language paradigm are “classes” and “objects” fundamental concepts?
A. Imperative C. Object-Oriented
B. Functional D. Declarative

A

Object-Oriented

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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

A

Translates assembly language into machine code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which of the following is a typical functional programming language?
a) Fortran c) Lisp
b) Java d) Prolog

A

Lisp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

. 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

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

A

An interpreter translates and runs code line by line, while a compiler translates the whole code at once

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

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

A

When you do not know the number of iterations or details of the condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

The paradigm that expresses computation in terms of logic predicates is known as:
a) Declarative
b) Imperative
c) Object-oriented
d) Functional

A

Declarative

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Which language was a major influence on the development of structured programming?
a) C++ c) Lisp
b) ALGOL d) Smalltalk

A

ALGOL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Which programming language feature is primarily responsible for improving reliability by preventing programs from crashing due to unexpected circumstances?
a) Expressiveness c) Syntax design
b) Exception handling d) Data structures

A

Exception handling

22
Q

Who invented the binary system and calculus?
A. Alan Turing
B. Gottfried Wilhelm Leibniz
C. Alonzo Church
D. Abu Ja’far Muhammad ibn Musa

A

Gottfried Wilhelm Leibniz

23
Q

What is a key drawback of highly expressive programming languages?
a) Reduced readability
b) Weaker data types
c) Less reliability
d) Limited exception handling

A

Reduced readability

24
Q

Which is NOT a characteristic of machine language?
A. Translation-free
B. Machine dependent
C. Error-prone
D. High-level abstraction

A

High-level abstraction

25
Prolog was originally designed for which application? a) Object-oriented programming b) Artificial intelligence c) Mathematical calculations d) System implementation
Artificial intelligence
26
Which criterion evaluates a software's ability to run on different platforms without modification? a. Performance b. Portability c. Stability d. System resource access
Portability
27
What ensures that a programming language enforces constraints on variable data types to prevent errors? a. Type Safety b. Analysis c. Learning curve d. Ease in debugging
Type Safety
28
Which factor determines the speed and efficiency of a software or programming language? a. Portability b. Performance c. Stability d. Analysis
Performance
29
What feature of a tool or language helps developers quickly locate and fix errors? a. Ease in debugging b. Learning curve c. Size (smaller is better) d. Stability
Ease in debugging
30
Which criterion assesses the ability of software to interact directly with the system hardware? a. System resource access b. Portability c. Analysis d. Stability
System resource access
31
What measures the reliability of software or tools under various conditions? a. Portability b. Stability c. Type Safety d. Analysis
Stability
32
What describes how easy it is to learn and start using a programming language or tool? a. Learning curve b. Performance c. Portability d. Analysis
Learning curve
33
Which factor considers the file or memory size of a software where smaller is better? a. Type Safety b. Size (smaller is better) c. Stability d. Availability in several facilities
Size (smaller is better)
34
Which term refers to the examination and interpretation of data or performance in programming? a. Analysis b. Portability c. System resource access d. Learning curve
Analysis
35
What measures how widely a tool or language can be used in various settings or applications? a. Availability in several facilities b. Ease in debugging c. Type Safety d. Size (smaller is better)
Availability in several facilities
36
Which programming language generation is directly executed by the hardware without any translation? a. Assembly Language b. Machine Language c. 3rd Generation Languages (3G) d. 4th Generation Languages (4G)
Machine Language
37
Which generation of programming languages introduced symbolic instructions and required assemblers for translation? a. Machine Language b. Assembly Language c. 3rd Generation Languages (3G) d. 5th Generation Languages (5G)
Assembly Language
38
Which generation of programming languages introduced high-level languages like C and FORTRAN? a. Assembly Language b. 3rd Generation Languages (3G) c. 4th Generation Languages (4G) d. 5th Generation Languages (5G)
3rd Generation Languages (3G)
39
Which programming language generation focuses on database and application development with minimal coding? a. 3rd Generation Languages (3G) b. 4th Generation Languages (4G) c. 5th Generation Languages (5G) d. Assembly Language
4th Generation Languages (4G)
40
Which generation of programming languages emphasizes artificial intelligence and logic-based problem solving? a. 3rd Generation Languages (3G) b. 4th Generation Languages (4G) c. 5th Generation Languages (5G) d. Machine Language
5th Generation Languages (5G)
41
Who is known for early contributions to algebra and laid the foundation for modern mathematics? a. Alan Turing b. Abu Ja’far Muhammad ibn Musa c. Stephen Kleene d. Gottlöb Frege
Abu Ja’far Muhammad ibn Musa
42
Which mathematician developed a binary numeral system and influenced computer science? a. Gottfried Wilhelm Leibniz b. Alonzo Church c. Dennis Ritchie d. Brian Kernighan
Gottfried Wilhelm Leibniz
43
Who is recognized for formalizing logic and laying the groundwork for predicate logic? a. Alan Turing b. Gottlöb Frege c. David Wheeler d. Kristen Nygaard
Gottlöb Frege
44
Who proposed the concept of a universal machine that could simulate any algorithm? a. Alan Turing b. Alonzo Church c. Stephen Kleene d. Brian Kernighan
Alan Turing
45
Which logician is associated with lambda calculus and influenced functional programming? a. Alan Turing b. Alonzo Church c. Dennis Ritchie d. Kristen Nygaard
Alonzo Church
46
Who worked alongside Alonzo Church and contributed to recursive function theory? a. Stephen Kleene b. Gottlob Frege c. David Wheeler d. Dennis Ritchie
Stephen Kleene
47
What thesis asserts that any effectively calculable function is computable by a Turing machine? a. Church’s Legacy b. Church-Turing Thesis c. Lambda Calculus d. Predicate Logic
Church-Turing Thesis
48
Who is credited with creating the first subroutine and influencing modular programming? a. David Wheeler b. Dennis Ritchie c. Brian Kernighan d. Alan Turing
David Wheeler
49
Which individual developed the C programming language? a. Dennis Ritchie b. Brian Kernighan c. David Wheeler d. Kristen Nygaard
Dennis Ritchie
50
Who co-authored the book The C Programming Language and contributed to Unix development? a. Dennis Ritchie b. Brian Kernighan c. Kristen Nygaard d. Stephen Kleene
Brian Kernighan
51
Who co-invented the Simula programming language and pioneered object-oriented programming? a. Kristen Nygaard b. Alan Turing c. Dennis Ritchie d. Gottlob Frege
Kristen Nygaard