FORM 4 Term 3 ASSESSMENT 1- 32 Marks 1. (a) Write pseudocode that will accept 25 integers and display the number of positive and negative numbers. [8mks]
(b) State whether the pseudocode uses a finite or indefinite loop.
[1mk]
(c) Give a reason for your answer in (b).
[2mks]
2. Convert the above code to Pascal.
[8mks]
3. (a) You need to determine if an object is a square. Draw a flowchart
that will: - Prompt for the length and width of the object - Accept and store the length and width of the object - Determine if the length is equal to the width - Display a message Object is a square if the length is equal to the width or message Object is not a square if the length is not equal to the width. [7mks]
(b) What construct is used in the flowchart?
[1mk]
4. Draw a trace table for the following algorithm:
X = 10 Y = 20 Z =5 X=X+Y Y=X-Y Z=Z+X X=Y Y=Z Z=X PRINT X, Y, Z [6mks]