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

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

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

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

20
Q

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

A

ALGOL

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
Q

Prolog was originally designed for which application?
a) Object-oriented programming
b) Artificial intelligence
c) Mathematical calculations
d) System implementation

A

Artificial intelligence

26
Q

Factors in Developing Programming Languages

A

Portability
Type Safety
Performance
Ease in debugging
System resource access
Stability
Learning curve
Size (smaller is better)
Analysis
Availability in several facilities

27
Q

Evolution of Programming Languages

A

Machine Language
Assembly Language
3rd Generation Languages (3G)
4th Generation Languages (4G)
5th Generation Languages (5G)

28
Q

Prominent Figures in Programming History

A

Abu Ja’far Muhammad ibn Musa
Gottfried Wilhelm Leibniz
Gottlöb Frege
Alan Turing
Alonzo Church
Stephen Kleene
Church’s Legacy
Church-Turing Thesis
David Wheeler
Dennis Ritchie
Brian Kernighan
Kristen Nygaard