Class 7 ICT Test ch 2
Class 7 ICT Test ch 2
Time: 45 minutes
Total Marks: 20
(2 Marks)
Define pseudocode and explain two key characteristics that make it useful in problem-solving.
(3 Marks)
The following pseudocode represents a simple algorithm:
lua
Copy code
input age
if age >= 18:
print("You can vote.")
else:
print("You cannot vote.")
(3 Marks)
The flowchart below describes an algorithm. Follow the steps and predict the output for x = 5.
mathematica
Copy code
Start
Input x
If x > 10:
Output "Large"
Else:
Output "Small"
End
a. Draw the flowchart for this pseudocode. (1 Mark)
b. Predict the output if x = 15. (1 Mark)
c. Predict the output if x = 5. (1 Mark)
(2 Marks)
Evaluate the following Boolean expressions:
(3 Marks)
Write a Python program using if, elif, and else to check if a number is positive, negative, or
zero.
(3 Marks)
a. What does it mean to decompose a problem? (1 Mark)
b. Break down the task of "making a sandwich" into smaller sub-tasks. (2 Marks)
(4 Marks)
You wrote the following Python code to calculate the area of a rectangle:
a. Write a test plan with two test cases to verify that the function works correctly. (2 Marks)
b. Explain how a test plan helps in debugging and refining programs. (2 Marks)