WorksheetsSession 5 - Computer Programming
Total questions: 21
Worksheet time: 17mins
Which of the following best describes the main purpose of an algorithm?
To follow logical steps to solve a task
To store temporary data in memory
To translate code into machine language
To debug errors in a program
A compiler helps programmers detect and fix logic errors in their code.
True
False
A set of instructions that tells the computer how to carry out a specific task in a logical sequence is called an (a) .
What is the role of syntax in programming?
To define how variables store data
To ensure that code follows language-specific rules
To test code performance
To improve processing speed
Incorrect syntax can prevent a program from running properly.
True
False
In programming, (a) refers to the structure and formatting rules that must be followed to write valid code.
What does a compiler do with the source code?
Saves it to the cloud
Turns it into machine-understandable instructions
Formats it for printing
Highlights errors automatically
A compiler translates low-level language into high-level language.
True
False
The (a) is responsible for converting code written by humans into a format that the computer's processor can execute.
Which statement about variables is correct?
They are used to print output to the screen
They cannot be changed after declaration
They hold and manage data values during execution
They compile programs automatically
A variable always keeps the same value throughout the execution of a program.
True
False
A (a) is a named space in memory where data can be stored, modified, and retrieved during program execution.
What is the main purpose of a function in programming?
To store permanent values
To structure the layout of the screen
To group code that performs a particular action
To translate user commands into machine language
Functions make code harder to read and maintain.
True
False
A (a) is a reusable block of code created to perform a specific task or operation.
What does the debugging process involve?
Testing only the user interface
Reviewing code without changing anything
Identifying and fixing mistakes in the code
Encrypting the software before release
Debugging ensures that a program runs without any visual design flaws.
True
False
The act of locating and correcting errors in a program is known as (a) .
Which of these best defines a loop?
A tool to convert text to binary
A method for storing large data files
A structure that repeats a set of instructions
A software for compiling code
Loops are used when a task needs to be done only once.
True
False
A (a) is a programming structure that executes a block of code multiple times, often based on a condition.
