2210 - 02 - Status - 01 - September 2022
2210 - 02 - Status - 01 - September 2022
For
Examiner
1. Describe, giving an example for each, the following data types used in programming. ’s
Integer: Description ………………...…………………………………………………….……... Use
…………………………….……………………………………………………………….……...
Example ……………………………...…………………………………………………….……...
Integer: Description ………………...…………………………………………………….……...
…………………………….……………………………………………………………….……...
Example ……………………………...……………………………………………………..….[4]
2. Give an example of a pseudocode statement or statements to perform each of the following
functions.
A condition controlled loop ………………………...……………………………………….……...
A conditional statement ....................................................................................................................
Totalling ......................................................................................................................................[3]
3. Read the following algorithm.
This pseudocode algorithm inputs two non-zero numbers and a sign, and then performs the
calculation shown by the sign. An input of zero for the first number terminates the process.
[6]
(b) Show how you could improve the algorithm written in pseudocode by writing an alternative
type of conditional statement in pseudocode.
……………………………………...……………………………………….……….……...
……………………………………...……………………………………….……….……...
16
…………………………………………...……………………………………………....[3]
Vegetarian
[4]
(c) The query-by-example grid below selects the entire double room with Vegetarian.
Field Booking Number Type of Room Vegetarian Room Number
Table Room_Booking Room_Booking Room_Booking Room_Booking
Sort Decending
Show √ √
Criteria =’Double’
or = TRUE
…………………………………………………………………...………………..…...[3]
…………………………………………………………………...………………..…...[2]
7. The following section of pseudo code inputs mark for 20 subjects, calculates total and
average of the mark and outputs total and average mark.
SET total, average = 1
SET counter = 1
FOR counter = 0 To 10
Input Mark
Total = Total + Marks
NEXT counter
SET Average = Total / 1
Output Total, Average
(a) Locate the three errors in the above program.
…………………………………………………………………………………………….
.…..………………………………………………...……………………………………...
…………………………………………………...……………………………..……...[3]
……………………………………………………………...………………............…....[2] 18
(c) Describe the other type of loop can be used above program
……………………………………….……………………………...………………..…...[2]
L AL
S
[5]
(c) Draw the logic circuit for the table.
……………………………………………………………...………………..............…....[2]
24
© HEGICT 2021 2210 / P2 / Mock 01 / June 2021