CAMBRIDGE IGCSE COMPUTER SCIENCE
February/March 2025 · Paper 22 · Question 10 · 15 marks
← 0478 CS Hub Paper 22 · Feb/Mar 2025 0478 / Paper 2 Question 10 15 MARKS
15-mark question lab · start here

From a sports-club register to a menu-driven membership program.

Build the solution in a sensible order: decode the menu requirements, plan the arrays and counters, initialise your own variables, drive the program from a validated menu, gate each new code through the LENGTH and uniqueness checks, store it in the first free slot, and finish with the list output and stop. Learn the reasoning before revealing the complete program.

Menu-driven loopLENGTH validationUniqueness searchFirst-free-slot storageParallel arrays15 marks

Learning targets

By the end, you should be able to explain the algorithm before writing it.

Lesson overview

01 · Understand

Identify the 1D and 2D arrays, their shared member index, the NewID input variable and the three choices the menu must offer.

02 · Construct

Wrap the program in a validated menu loop and gate every new code through the LENGTH = 6 test and the uniqueness search before storing it in the first available space.

03 · Complete

Input the first and last names into the matching location of Name[], output the full member list with suitable messages, and stop only when the menu offers it.

!

How Cambridge awards the marks: the mark scheme gives AO2 a maximum of 9 marks and AO3 a maximum of 6 marks. It lists requirements R1–R5, but does not assign a separate fixed mark total to each R requirement. The stage-to-mark links in this guide show alignment, not invented stage marks.

Source question

Read the whole question first

Do not begin coding after the first paragraph. The shared member index, the six-character gate and the first-available-space rule all affect the structure of your solution.

Question 10 · 15 marks
Cambridge IGCSE Computer Science · 0478/22 · Question 10

A sports club uses a six-character alphanumeric membership code to identify each member of the club. The one-dimensional (1D) array MemberID[] is used to store the unique membership codes for club members. The two-dimensional (2D) array Name[] is used to store the names of the club members. The first and last name of each member will be stored in separate array elements.

The system can store details for a maximum of 1000 members. The position of any member’s data is the same in both arrays. For example, the data in index 2 of MemberID[] belongs to the member in index 2 of Name[].

The variable NewID is used to input a new membership code.

Write a program that meets the following requirements:

  • Provide a menu that offers the choices: inputting a new member, outputting a list of membership codes and first and last names, or stopping.
  • Input and validate a response to the menu.
  • When inputting a new member, input a new membership code and check that it contains six characters:
    • If the new code is six characters, check it against all the previously stored membership codes to make sure it is unique.
    • If the code is not unique, a new code must be entered and checked.
    • If the code is unique, it is stored in the first available space in the appropriate array and the new member is required to enter their first name and last name, which are also stored in the corresponding location of the appropriate array.
  • When outputting a list of membership codes and names, output for each member: their membership code, first name and last name.
  • The program will continue until the stop option on the menu is selected.

You must use pseudocode or program code and add comments to explain how your code works.

You do not need to declare any arrays, variables or constants; assume this has already been done.

You do not need to initialise the data in the arrays.

You do need to initialise any variables or constants used if appropriate.

All inputs and outputs must contain suitable messages.

Before you move on

These are the five required techniques identified by the Cambridge mark scheme.

Mark-scheme map
R1

Provide a three-option menu — input a new member, output the list, or stop — and input and validate the response.

R2

Input a new membership code and check that it contains six characters before anything else happens to it.

R3

Check a six-character code against all the previously stored codes; a code that is not unique must be re-entered and checked again.

R4

Store the unique code in the first available space and input the first and last names into the corresponding location of Name[].

R5

Output each member’s code, first name and last name, and repeat the menu until the stop option is selected.

Use the tabs along the top to work through the seven stages. The complete solution is kept in its own tab, and the interactive visualisation is the final tab.