Question 1 Report
The attendance program is to be used at a college workshop. At the start of each session, a technician enters a student ID at a keyboard. The main program must reject an empty entry and IDs that are not exactly six digits before it writes a record to the attendance file. The file is later read by a separate program to display the names of absent students.
(a) Explain why validation is needed before the new attendance record is saved. [2]
(b) When the file is opened for the first time on a new day, state the most suitable file mode. [1]
In the box-office program for a small theatre, each successful booking is written to a daily file. A customer enters the number of seats required, and the program displays either a confirmation message or an error message. The manager wants the program to prevent a booking of zero seats and to keep all earlier bookings in the same file.
(a) Explain why the number of seats should be validated as greater than zero. [2]
(b) When a later booking is saved, state the file mode that should be used. [1]
Workshop attendance
Theatre bookings
Everything you need to excel in your exams