Computer Science (0478) · Oct/Nov 2015 · PRE 23
Cambridge Computer Science (0478) pre for paper 23, Oct/Nov 2015 — 0478/23/O/N/15, file 0478_w15_pre_23.pdf.
Text of this paper
www.dynamicpapers.com
Cambridge International Examinations
Cambridge International General Certificate of Secondary Education
* 0 4 4 0 3 9 3 4 0 3 *
0478/23
COMPUTER SCIENCE
Paper 2 Problem-solving and Programming
October/November 2015
PRE-RELEASE MATERIAL
No Additional Materials are required.
This material should be given to candidates on receipt by the Centre.
READ THESE INSTRUCTIONS FIRST
Candidates should use this material in preparation for the examination. Candidates should attempt the
practical programming tasks using their chosen high-level, procedural programming language.
This document consists of 2 printed pages.
DC (CW) 95078/2
© UCLES 2015
[Turn over
www.dynamicpapers.com
2
Candidates’ preparation for the examination should include attempting the following practical program
coding tasks.
Write and test a program to complete the three tasks.
The temperature in an apartment needs to be kept between 22°C and 24°C. This is done by the use of
an automatically controlled air-conditioning system, which monitors the temperature every five minutes.
The temperature of the apartment is recorded, to one decimal place, in degrees Celsius. The cooling
is activated when the temperature reaches 24.5°C and the heating is activated when the temperature
reaches 21.5°C.
TASK 1
To simulate the monitoring required, write a routine that allows entry of the apartment’s temperature in
degrees Celsius. The routine checks whether the temperature is within the acceptable range, too high
or too low and outputs a suitable message in each case.
TASK 2
Write another routine that stores, in an array, the temperatures taken over a period of five hours.
This routine calculates the difference between the highest temperature and the lowest temperature.
Then it outputs the highest temperature, the lowest temperature, and the difference between these
temperatures.
TASK 3
Write a routine to find out how often the temperature was out of the acceptable range during the five
hours and whether the temperature was too high or too low; output a suitable message showing a
summary of the problem.
Your program must include appropriate prompts for the entry of data. Error messages and other output
need to be set out clearly and understandably. All variables, constants and other identifiers must have
meaningful names. Each task must be fully tested.
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every 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 International
Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after
the live examination series.
Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local
Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge.
© UCLES 2015
0478/23/O/N/15