Grade 9 Comp
Grade 9 Comp
Final mark:
Comments:
2
1. Multiple Choice. Choose the correct option and write the letter on the space
provided[15]
______1 What is the purpose of pseudocode?
a) To write final executable code
b) To explain an algorithm in a human-readable way
c) To design graphics for a program
d) To replace programming languages
______2 Which of the following is NOT a characteristic of a good algorithm?
a) It must be finite
b) It must be unambiguous
c) It must be complex and difficult to understand
d) It must produce a correct output
______3 What does a flowchart use to visually represent an algorithm?
a) Text and paragraphs
b) Symbols and arrows
c) Tables and graphs
d) Screenshots of code
______4 What is a logic error in pseudocode?
a) An error in the syntax of the pseudocode
b) An error that causes the program to crash
c) An error where the program runs but produces incorrect results
d) An error in hardware
______5 In a flowchart, which shape is commonly used to represent a decision?
a) Oval
b) Rectangle
c) Diamond
d) Circle
______6 What is iteration in programming?
a) A type of error in a program
b) The process of repeating a set of instructions
c) A way to define variables
d) A type of condition in a loop
______7 Which loop repeats a set number of times?
a) Condition-controlled loop
b) Count-controlled loop
2. True or False Questions. IF the statement is true: write T, ELSE: write F [15]
condition, condition-controlled loop, count-controlled loop, For loop, increment, infinite loop,
iteration, loop, algorithm, logic, flowchart, oval or terminator, actual or programming, append(),
array, Boolean, casting, character, data structure, index, integer, Len(), List, Lower(), nesting, real,
string, Upper()
© UCLES 2015 0417/11/O/N/15
5
1. A(n) ________ is a step-by-step procedure for solving a problem.
2. A ________ error occurs when a program runs but produces an incorrect output.
1. Pseudocode
_________________________________________________________________________
_________________________________________________________________________
2. Binary search
_________________________________________________________________________
_________________________________________________________________________
3. Syntax error
_________________________________________________________________________
_________________________________________________________________________
4. Validation
_________________________________________________________________________
_________________________________________________________________________
5. Efficiency
_________________________________________________________________________
_________________________________________________________________________
In the world of computers, hardware and software work together to make a computer functional.
Hardware refers to the physical components of a computer, such as the CPU (Central Processing
Unit), RAM (Random Access Memory), and storage devices like hard drives or solid-state drives.
Software, on the other hand, is the collection of programs and applications that run on the
computer. It includes the operating system, programs like Microsoft Word, and tools for
programming like Python or Java.
To interact with computers, we use input and output devices. Input devices allow users to send
data into the computer. Some examples are keyboards, mice, microphones, and scanners. These
devices collect data or commands from the user, which is then processed by the computer. On the
other hand, output devices display or produce the results of a computer's processing. Monitors,
printers, and speakers are examples of output devices that allow us to see, hear, or print the
processed data.
Now, when we create programs, we need to understand how to manage data and control how
information flows in the program. Programming with data involves using data structures like arrays
or lists, which allow us to store multiple values, such as integers, real numbers, strings, and
Boolean values. For example, a list in Python can store a collection of data, and we can access
these values using indexes. The Len () function is used to find the number of elements in a list,
and we can use the append () function to add new elements.
When we need to process data or repeat actions, we use loops like the For in Range loop, which
repeats a set of instructions a specific number of times. Condition-controlled loops are used when
we don’t know how many times a loop will run, and it continues until a certain condition is met.
These loops help us automate tasks that would otherwise be repetitive.
Pseudocode is a tool used to design algorithms before writing actual code. It helps programmers
plan out the steps of a program using simple, easy-to-understand language. In pseudocode, we
use commands like "if" for decision-making, "for" and "while" for loops, and "append ()" for adding
data to a list. For example, a pseudocode to sum the numbers in a list might look like this:
Start
Initialize total to 0
End For
Print total
End
Understanding how hardware and software interact, as well as knowing how to manipulate data in
your programs, is crucial for creating effective computer programs. By learning to plan and break
down problems into pseudocode, we can efficiently write real code in programming languages like
Python.
Questions [15]