wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Programming Languages Chapter 1 & 2 Quiz Review

Total questions: 16

Worksheet time: 8mins

Name
Class
Date
1.

What is the main purpose of abstraction in programming languages?

a)

To slow down program execution

b)

To simplify complex systems by focusing on essential details

c)

To directly translate programs into machine code

d)

To eliminate all errors in code

2.

Which components make up a generic abstract machine?

a)

Compiler and Interpreter

b)

Store and Interpreter

c)

Stack and Heap

d)

Processor and Registers

3.

Which of the following is a low-level language

a)

Java

b)

C++

c)

Assembly

d)

Python

4.

A complier differs from an interpreter because:

a)

It produces machine code before execution

b)

It directly executes code without translation

c)

It always runs faster than interpreters

d)

It only works with high-level languages

5.

Which is NOT one of the four main programming paradigms?

a)

Imperative

b)

Object-Oriented

c)

Functional

d)

Symbolic

6.

Functional Programming allows assignment statements like x=x+1

a)

True

b)

False

7.

Which programming paradigm models computation as rules or constraints instead of commands?

a)

Functional

b)

Object-Oriented

c)

Logic

d)

Imperative

8.

Event-driven programming is most commonly paired with which paradigm?

a)

Object-Oriented

b)

Functional

c)

Logic

d)

Imperative

9.

The syntax of a language refers to:

a)

The meaning of a program

b)

The structure and rules of valid programs

c)

The runtime performance of a program

d)

The memory management of a program

10.

Which formalism is used to describe programming language syntax?

a)

Regex

b)

ASCII

c)

Backus-Naur Form (BNF)

d)

Machine Code

11.

Which of the following is a token?

a)

Identifier

b)

Compiler

c)

Abstract Machine

d)

Heap

12.

In the compilation process, which phase comes immediately after lexical analysis?

a)

Code generation

b)

Parsing

c)

Semantic analysis

d)

Optimization

13.

Whitespace and comments are preserved during lexical analysis.

a)

True

b)

False

14.

The main difference between a parse tree and an abstract syntax tree (AST) is:

a)

Parse trees are smaller

b)

ASTs remove unnecessary details

c)

Parse trees only apply to low-level languages

d)

ASTs are slower to generate

15.

Which of the following character sets is used internationally to represent nearly all written languages?

a)

ASCII

b)

Unicode

c)

BNF

d)

Hexadecimal

16.

Which of the following is NOT a token type?

a)

Identifiers

b)

Literals

c)

Keywords

d)

Algorithms