Question 1 Report
For each club meeting, the school activities program asks a leader to enter a member number. It reads a membership file and displays the member name before writing attendance to a separate file. A leader may accidentally enter letters instead of digits. The program includes a validation subroutine so that the same test can be used by every club.
(a) Explain one advantage of using a validation subroutine. [2]
(b) State the input data type expected for a member number. [1]
(c) When a member is found, explain why displaying the name before saving attendance is useful. [1]
In a multiplayer quiz game, the server stores each player's name and score in a leaderboard file after a round. The main program reads the file to display the top five players on a large board. A player name must contain from 3 to 12 characters, and the program must not save a score if the name is invalid. The game host can use an administrative command to clear the leaderboard before a new tournament.
(a) Explain why the name length should be validated before the score is written. [2]
(b) When displaying the leaderboard, state the output device used for the board. [1]
(c) Explain why clearing the leaderboard should be limited to the administrative command. [1]
Club attendance
Quiz-game leaderboard
Everything you need to excel in your exams