9608_w21_qp_32
A paper of Computer Science, 9608
Questions:
8
Year:
2021
Paper:
3
Variant:
2

Login to start this paper & get access to powerful tools

1
3
5
6
8
A large car park has 6 floors. There is a large screen at the entrance to the car park. This screen displays the number of empty parking spaces on each floor. • There are 256 parking spaces for cars on each floor. • Each parking space has a sensor that detects if a car is parked on it. • Data from the sensors are read and processed by a computer system. Identify the type of system described. Justify your answer to part . Identify two types of sensor that could be used by this system. Sensor 1 Sensor 2 A program regularly checks each sensor’s readings. The number of empty parking spaces is displayed on the screen for each floor. If there are no empty parking spaces on a floor, a message is displayed on the screen to show that the floor is full. The pseudocode algorithm to display this information has been written using these identifiers. Identifier Data type Description FloorNumber INTEGER Floor number SpaceNumber INTEGER Parking space number SpaceAvailable INTEGER Counts number of empty parking spaces on a floor ForEver BOOLEAN Value to ensure continuous loop The pseudocode algorithm uses the function CheckSpace(Floor, Space). This function returns TRUE if the parking space is empty and FALSE otherwise. Complete the following pseudocode algorithm to check the number of parking spaces available. 01 ForEver ………………………………………………………………………… 02 REPEAT 03 FOR FloorNumber 1 TO ………………………………………………………………………… 04 SpaceAvailable 05 FOR SpaceNumber 1 TO ………………………………………………………………………… 06 IF CheckSpace(FloorNumber, SpaceNumber) 07 THEN 08 SpaceAvailable SpaceAvailable + 1 09 ENDIF 10 ENDFOR 11 IF SpaceAvailable > ………………………………………………………………………… 12 THEN 13 OUTPUT "Floor ", …………………………………………………………………………, " empty parking spaces "………………………………………………………………………… 14 ELSE 15 OUTPUT "Floor ", …………………………………………………………………………, " full" 16 ENDIF 17 ENDFOR 19 // delay loop 20 // delay loop 21 UNTIL ………………………………………………………………………… Write a delay loop in pseudocode for lines 19 and 20 of the pseudocode algorithm. State why a delay loop is used in this system. When a car is parked in a parking space, a bit is set in the appropriate memory location. • 32 memory locations are used for each floor with address X01 to X32, where X is the number of the floor. • Each location is one byte in length to hold the data for 8 parking spaces. For example, memory location 101 is used for parking spaces 1 to 8 and memory location 102 is used for parking spaces 9 to 16. The table shows part of floor 1 with cars parked in parking spaces 4, 11, 16 and 255. Memory location Bits Parking space number 8 – 1 16 – 9 … … … … … … … … … … 256 – 249 The data in memory location 604 is shown. State what this data represents. Explain the way in which the parking space 254 on floor 5 can be checked to see if it is empty.