Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Session 5 - Computer Programming

Total questions: 21

Worksheet time: 17mins

Name
Class
Date
1.

Which of the following best describes the main purpose of an algorithm?

a)

To follow logical steps to solve a task

b)

To store temporary data in memory

c)

To translate code into machine language

d)

To debug errors in a program

2.

A compiler helps programmers detect and fix logic errors in their code.

a)

True

b)

False

3.

A set of instructions that tells the computer how to carry out a specific task in a logical sequence is called an (a)   .

4.

What is the role of syntax in programming?

a)

To define how variables store data

b)

To ensure that code follows language-specific rules

c)

To test code performance

d)

To improve processing speed

5.

Incorrect syntax can prevent a program from running properly.

a)

True

b)

False

6.

In programming, (a)   refers to the structure and formatting rules that must be followed to write valid code.

7.

What does a compiler do with the source code?

a)

Saves it to the cloud

b)

Turns it into machine-understandable instructions

c)

Formats it for printing

d)

Highlights errors automatically

8.

A compiler translates low-level language into high-level language.

a)

True

b)

False

9.

The (a)   is responsible for converting code written by humans into a format that the computer's processor can execute.

10.

Which statement about variables is correct?

a)

They are used to print output to the screen

b)

They cannot be changed after declaration

c)

They hold and manage data values during execution

d)

They compile programs automatically

11.

A variable always keeps the same value throughout the execution of a program.

a)

True

b)

False

12.

A (a)   is a named space in memory where data can be stored, modified, and retrieved during program execution.

13.

What is the main purpose of a function in programming?

a)

To store permanent values

b)

To structure the layout of the screen

c)

To group code that performs a particular action

d)

To translate user commands into machine language

14.

Functions make code harder to read and maintain.

a)

True

b)

False

15.

A (a)   is a reusable block of code created to perform a specific task or operation.

16.

What does the debugging process involve?

a)

Testing only the user interface

b)

Reviewing code without changing anything

c)

Identifying and fixing mistakes in the code

d)

Encrypting the software before release

17.

Debugging ensures that a program runs without any visual design flaws.

a)

True

b)

False

18.

The act of locating and correcting errors in a program is known as (a)   .

19.

Which of these best defines a loop?

a)

A tool to convert text to binary

b)

A method for storing large data files

c)

A structure that repeats a set of instructions

d)

A software for compiling code

20.

Loops are used when a task needs to be done only once.

a)

True

b)

False

21.

A (a)   is a programming structure that executes a block of code multiple times, often based on a condition.