Past-paper question · 2023 May-June · Paper 22 · Q12

Question 12 2023 · May-June · Paper 22 · 15 marks

Original past-paper question for 12
Original past-paper question for 12
Original past-paper question for 12
Original past-paper question for 12
Reveal official mark-scheme answer Official mark-scheme answer for 12

Official answer for Question 12

✓
Read the whole answer:

Question 15

✓
Check if each requirement listed below has been met. Requirements may be met using a suitable built-in function from the
✓
programming language used (Python, VB.NET or Java)
✓
Mark SEEN on script if requirement met, cross if no attempt seen, NE if partially met (see marked scripts).
✓
Use the tables for A02 and A03 below to award a mark in a suitable band using a best fit approach
✓
Then add up the total.
✓
Marks are available for:
✓
AO2 (maximum 9 marks)
✓
AO3 (maximum 6 marks)
✓
Data Structures required names shown underlined must be used as given in the scenario
✓
Arrays or lists Account, AccDetails
✓
Variable Size, AccountNumber
✓
Requirements (techniques)
✓
R1 Check account number and password (iteration and validation, selection, input, output)
✓
R2 Display menu and make a selection (output, input and selection)
✓
R3 Perform actions selected (use of arrays and procedures with parameters)
✓
Example 15 mark answer in pseudocode
✓
// Procedures to be called
✓
PROCEDURE CheckDetails(AccID : INTEGER)
✓
DECLARE Name, Password : STRING // local variables
✓
Valid FALSE
✓
IF AccID <0 OR AccID > Size
✓
THEN
✓
OUTPUT "Invalid Account Number"
✓
ELSE
✓
OUTPUT "Please Enter Name "
✓
INPUT Name
✓
OUTPUT "Please Enter Password "
✓
INPUT Password
✓
IF Name <> Account[AccID,1] OR Password <> Account[AccID,2]
✓
THEN
✓
OUTPUT "Invalid name or password"
✓
ELSE
✓
0478/22
✓
Cambridge IGCSE – Mark Scheme
✓
May/June 2023
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 0478_s23_ms_22.pdf →

Show text version of question

Question 12

A
two-dimensional (2D) array Account[] contains account holders’ names and passwords for a

banking program.

A
2D array AccDetails[] has three columns containing the following details:
  • column one stores the balance – the amount of money in the account, for example 250.00
  • column two stores the overdraft limit – the maximum total amount an account holder can
  • borrow from the bank after the account balance reaches 0.00, for example 100.00

  • column three stores the withdrawal limit – the amount of money that can be withdrawn at one

time, for example 200.00

The amount of money in a bank account can be negative (overdrawn) but not by more than the overdraft limit. For example, an account with an overdraft limit of 100.00 must have a balance that is greater than or equal to –100.00

Suitable error messages must be displayed if a withdrawal cannot take place, for example if the overdraft limit or the size of withdrawal is exceeded.

The bank account ID gives the index of each account holder’s data held in the two arrays. For example, account ID 20’s details would be held in: Account[20,1] and Account[20,2] AccDetails[20,1] AccDetails[20,2] and AccDetails[20,3]

The variable Size contains the number of accounts.

The arrays and variable Size have already been set up and the data stored.

Write a program that meets the following requirements:

  • checks the account ID exists and the name and password entered by the account holder
  • match the name and password stored in Account[] before any action can take place

  • displays a menu showing the four actions available for the account holder to choose from:
  • 1. display balance 2. withdraw money 3. deposit money 4. exit

  • allows an action to be chosen and completed. Each action is completed by a procedure

with a parameter of the account ID.

You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs must contain suitable messages.

You only need to declare any local arrays and local variables that you use.

You do not need to declare and initialise the data in the global arrays Account[] and AccDetails[] and the variable Size

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Question 13

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Question 14

..........................................................................................................................................................

.........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..................................................................................................................................................

[15]

Question 15

Question 16

reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cambridgeinternational.org after the live examination series.

Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.

Topic relevance

Why this question appears here

98% assigned-topic match · Programming › Programming concepts

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 0478_s23_qp_22.pdf

Keep practising this topic