The museum archive program is to create a label for each newly scanned photograph. An operator enters the cabinet code BX7 and the photograph number 184. Th...

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

Question 1 Report

The museum archive program is to create a label for each newly scanned photograph. An operator enters the cabinet code BX7 and the photograph number 184. The main program must display one text message in this format:

BX7:184

The two values are stored as strings. The skeleton program contains the statement:

label ← cabinetCode ... photoNumber

(a) State the string operator that should replace the dots in the statement. [1]
(b) Describe the value stored in label(c) Explain why the program should not use an arithmetic addition operator to combine these two entered values. [3]
(d) Suggest one test value for cabinetCode that would help a programmer check that the displayed message is still clear when a cabinet has a longer code. [2]

Answer Details

(a) Use a concatenation operator, for example + or &, to join the string values. [1]

(b) The value stored in label is one string containing BX7, then a colon, then 184. [1] It is displayed as BX7:184. [1]

(c) The entered values are strings, meaning text data. [1] Arithmetic addition is used for numeric values, not to build text labels. [1] Concatenation joins characters to produce the required label. [1]

(d) A suitable longer test value is BX7WEST or CABINET12. [1] Use it with a photograph number to check that the complete label remains readable and is joined correctly, for example BX7WEST:184. [1]

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