During a harbour safety inspection, an officer records information about each moored boat on a handheld device. The new program asks for the berth code, hul...

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

Question 1 Report

During a harbour safety inspection, an officer records information about each moored boat on a handheld device. The new program asks for the berth code, hull length in metres, inspection date and whether a life ring is present. The officer can enter several records before choosing a command to stop. A report is then displayed for the harbour manager. The programmers are deciding which values need variables and which can be constants.

(a) State one item in this program that could be stored in a Boolean variable. [1]
(b) State one item that should be stored as a real number. [1]
(c) Explain why the berth code should be stored as a string even when it contains digits. [2]

Answer Details

(a) Whether a life ring is present, for example lifeRingPresent, can be stored as a Boolean variable because the answer is yes/no or true/false. [1]

(b) Hull length should be stored as a real number because a length in metres may have decimal places. [1]

(c) A berth code is an identifier, not a quantity to calculate with. It should therefore be a string, particularly because codes may contain letters, symbols, or leading zeroes that numeric storage would not preserve suitably. [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