Fig. 1 shows the score-entry page for a school quiz game. The quiz controller enters a player name, the round score, the time taken and whether the player u...

Assessment: Computer Science 9210 | Paper 1 Mock 01 | Programming (on-screen) Subject: Computer Science - 9210

Question 1 Report

9210-p1-data-types-10

Fig. 1 shows the score-entry page for a school quiz game. The quiz controller enters a player name, the round score, the time taken and whether the player used a hint. The game program adds the round score to a total and displays a message when a hint has been used. A new programmer has suggested using a real number for every value because the computer can store decimal values.

(a) When the time taken is 18.4 s, state a suitable data type. [1]
(b) Explain why usedHint should not be stored as a real number. [2]
(c) When a player name is entered, state a suitable data type. [1]



In the main program for a community radio station, a presenter selects a music file, enters the planned start time and chooses whether a news bulletin must follow it. A subroutine checks the file name before the item is added to the schedule. The producer has found that some users enter a start time such as 99:75, which is displayed but cannot be broadcast correctly.

(a) State one validation method that could reject 99:75. [1]
(b) Describe the values that this validation should accept for the hour and minute parts. [2]
(c) Explain why validation improves the reliability of the scheduling program. [2]

Answer Details

Quiz game

(a) Time taken should be a real (floating-point) number because 18.4 s includes a decimal part. [1]

(b) Hint use has only two states: used or not used. It should therefore be Boolean, not a real number, because Boolean is designed for logical conditions. [2]

(c) A player name should be a string. [1]

Radio scheduling program

(a) A range check or format check could reject 99:75. [1]

(b) The hour must be from 00 to 23 inclusive, and the minute must be from 00 to 59 inclusive. [2]

(c) Validation stops invalid data before it is stored or used. Therefore later actions, such as ordering scheduled items or starting playback, are less likely to fail or create an incorrect schedule. [2]

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning