Past-paper question · 2024 October-November · Paper 22 · Q12

Question 12 2024 · October-November · 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

✓
AO2 (maximum 9 marks)

Question 15

✓
•
✓
AO3 (maximum 6 marks)
✓
Data Structures required with names as given in the scenario:
✓
Arrays or lists Rooms[], Dimensions[]
✓
Variables
✓
Number
✓
Requirements (techniques):
✓
R1 Input and store number of rooms, the names of the rooms and their
✓
dimensions, including validation of number of rooms (input with prompts,
✓
(nested) iteration, use of variables, 1D and 2D arrays, validation).
✓
R2 Calculate and store the area of each room, the total area of the house
✓
and the average room area rounded to two decimal places. Find the
✓
smallest and largest rooms (calculation, totalling, rounding, finding
✓
maximum and minimum values, iteration).
✓
R3 Output the results, including contents of the arrays and the calculated
✓
data (iteration, output).
✓
Example 15-mark answer in pseudocode
✓
// input and validation of number of rooms
✓
REPEAT
✓
OUTPUT "How many rooms are in your house (enter a
✓
number between 3 and 20 inclusive)?"
✓
INPUT Number
✓
IF Number < 3 OR Number > 20
✓
THEN
✓
OUTPUT "The number of rooms must be between 3 and
✓
20 inclusive, please try again"
✓
ENDIF
✓
UNTIL Number >= 3 AND Number <= 20
✓
// input of room names and dimensions – could be more
✓
than one loop
✓
FOR InLoop 1 TO Number
✓
OUTPUT "Enter the name of room ", InLoop
✓
INPUT Rooms[InLoop]
✓
OUTPUT "Enter the length of the room in metres"
✓
INPUT Dimensions[InLoop, 1]
✓
OUTPUT "Enter the width of the room in metres"
✓
INPUT Dimensions[InLoop, 2]
✓
Dimensions[InLoop, 3] ROUND(Dimensions[InLoop, 1]
✓
* Dimensions[InLoop, 2], 2)
✓
NEXT InLoop
✓
// calculates total area and average area – rounded
✓
values have been stored
✓
TotArea 0
✓
FOR Total 1 TO Number
✓
TotArea TotArea + Dimensions[Total, 3]
✓
NEXT Total
✓
AvArea ROUND(TotArea / Number, 2)
✓
Cambridge IGCSE – Mark Scheme
✓
0478/22
✓
October/November
✓
PUBLISHED
✓
2024
✓
Question
✓
Answer
✓
Marks
✓
// finding largest and smallest rooms

Mark scheme 0478_w24_ms_22.pdf →

Show text version of question

Question 12

A
one-dimensional (1D) array Rooms[] contains the names of up to 20 rooms in a house.
A
two-dimensional (2D) array Dimensions[] is used to store the length, width and area of each

room.

The position of any room’s data is the same in both arrays. For example, the data in index 5 of Dimensions[] belongs to the room in index 5 of Rooms[]

The variable Number stores the number of rooms for which data is to be input. There must be at least 3 rooms but no more than 20.

Write a program that meets the following requirements:

  • allows the number of rooms for which data is required to be input, stored and validated
  • allows the name of the room and the length and width of the room, in metres, to be entered
  • and stored

  • allows the area of each room to be calculated as length multiplied by width and stored as
  • square metres rounded to two decimal places

  • calculates the average size of all the rooms by area, in square metres, rounded to two decimal
  • places

  • finds the largest room and smallest room by area
  • outputs the names of all rooms with their dimensions and area
  • outputs the names of the largest room and smallest room by area
  • outputs the total area of the house and the average size of all the rooms by area.

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

You do not need to declare any arrays or variables; you may assume that this has already been done.

All inputs and outputs must contain suitable messages.

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

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

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

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

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

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

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

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

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

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

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

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

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

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 › Arrays

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_w24_qp_22.pdf

Keep practising this topic