Question 1 Report
The repair workshop uses the tablet display in Fig. 1 for bicycle inspections. A mechanic enters a repair ticket, wheel diameter, number of faults and whether the bicycle is safe to collect. The ticket is used to retrieve a record, while wheel diameter helps select a replacement part. The main program calls a subroutine that rejects values with the wrong data type before the record is saved.
(a) When wheel diameter is 26.5 inches, state a suitable data type. [1]
(b) Explain why repair ticket R0031 should be stored as a string. [2]
(c) When safeToCollect is stored, state a suitable data type. [1]
(a) Wheel diameter should be a real (floating-point) number because 26.5 includes a decimal value. [1]
(b) R0031 should be a string: it contains a letter and leading zeroes, and it is a reference used to find a record rather than a value for arithmetic. Storing it numerically could lose the zeroes. [2]
(c) safeToCollect should be Boolean because the bicycle is either safe to collect or not safe to collect. [1]
Everything you need to excel in your exams