NEW
Font size
WorksheetsProgramming Languages Chapter 1 & 2 Quiz Review
Total questions: 16
Worksheet time: 8mins
What is the main purpose of abstraction in programming languages?
To slow down program execution
To simplify complex systems by focusing on essential details
To directly translate programs into machine code
To eliminate all errors in code
Which components make up a generic abstract machine?
Compiler and Interpreter
Store and Interpreter
Stack and Heap
Processor and Registers
Which of the following is a low-level language
Java
C++
Assembly
Python
A complier differs from an interpreter because:
It produces machine code before execution
It directly executes code without translation
It always runs faster than interpreters
It only works with high-level languages
Which is NOT one of the four main programming paradigms?
Imperative
Object-Oriented
Functional
Symbolic
Functional Programming allows assignment statements like x=x+1
True
False
Which programming paradigm models computation as rules or constraints instead of commands?
Functional
Object-Oriented
Logic
Imperative
Event-driven programming is most commonly paired with which paradigm?
Object-Oriented
Functional
Logic
Imperative
The syntax of a language refers to:
The meaning of a program
The structure and rules of valid programs
The runtime performance of a program
The memory management of a program
Which formalism is used to describe programming language syntax?
Regex
ASCII
Backus-Naur Form (BNF)
Machine Code
Which of the following is a token?
Identifier
Compiler
Abstract Machine
Heap
In the compilation process, which phase comes immediately after lexical analysis?
Code generation
Parsing
Semantic analysis
Optimization
Whitespace and comments are preserved during lexical analysis.
True
False
The main difference between a parse tree and an abstract syntax tree (AST) is:
Parse trees are smaller
ASTs remove unnecessary details
Parse trees only apply to low-level languages
ASTs are slower to generate
Which of the following character sets is used internationally to represent nearly all written languages?
ASCII
Unicode
BNF
Hexadecimal
Which of the following is NOT a token type?
Identifiers
Literals
Keywords
Algorithms
