The organiser of a night market needs a program to allocate stalls. Each trader enters a business name, a stall width, an electricity request and a contact ...

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

Question 1 Report

The organiser of a night market needs a program to allocate stalls. Each trader enters a business name, a stall width, an electricity request and a contact telephone number. The system calculates the total width used on each row of the market. Before a record is saved, the program must reject impossible input and give the trader a useful message. The programmer has written a subroutine named checkWidth.

(a) State the data type for electricityRequested. [1]
(b) Describe the purpose of a presence check on the business name. [1]
(c) Explain why a range check is appropriate for stall width. [2]
(d) Suggest two normal test data values for checkWidth, if the permitted width is from 1.0 m to 4.0 m inclusive. [2]

Answer Details

(a) electricityRequested should be Boolean, because the request has two states: requested or not requested. [1]

(b) A presence check prevents an empty or blank business name from being accepted. [1]

(c) A range check ensures stall width is between the permitted minimum and maximum. This prevents an allocation that is too narrow, too wide, or unrealistic. [2]

(d) Two normal test values are 1.0 m and 2.5 m. Both are within the inclusive permitted range of 1.0 m to 4.0 m, so both should be accepted. A value of 4.0 m is also acceptable. [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