0% found this document useful (0 votes)
159 views

Class 7 ICT Test ch 2

Uploaded by

hamza Shahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
159 views

Class 7 ICT Test ch 2

Uploaded by

hamza Shahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Class 7 ICT Test

Time: 45 minutes
Total Marks: 20

Question 1: Key Characteristics of Pseudocode

(2 Marks)
Define pseudocode and explain two key characteristics that make it useful in problem-solving.

Question 2: Understanding Algorithms

(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.")

a. What will the output be if age = 20? (1 Mark)


b. What will the output be if age = 16? (1 Mark)
c. Briefly explain how the conditional statement works in this pseudocode. (1 Mark)

Question 3: Flowcharts and Conditional Statements

(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)

Question 4: Boolean Logic

(2 Marks)
Evaluate the following Boolean expressions:

1. (7 > 3) AND (4 < 5)


2. NOT (10 == 10)
3. (6 < 2) OR (9 > 8)

Question 5: Python Conditional Statements

(3 Marks)
Write a Python program using if, elif, and else to check if a number is positive, negative, or
zero.

Question 6: Decomposing Problems

(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)

Question 7: Test Plan

(4 Marks)
You wrote the following Python code to calculate the area of a rectangle:

def calculate_area(length, width):


return length * width

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)

You might also like