Computer Science (9608) · Oct/Nov 2018 · PM 41

Cambridge Computer Science (9608) pm for paper 41, Oct/Nov 2018 — 9608/41/O/N/18, file 9608_w18_pm_41.pdf.

Advertisement
Loading the paper…
Text of this paper

www.dynamicpapers.com

Cambridge International Examinations
Cambridge International Advanced Subsidiary and Advanced Level

9608/41

COMPUTER SCIENCE
Paper 4 Further Problem-solving and Programming Skills

October/November 2018

PRE-RELEASE MATERIAL
* 7 0 7 7 7 1 4 6 8 5 *

No Additional Materials are required.
This material should be given to the relevant teachers and candidates as soon as it has been received
at 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 7 printed pages and 1 blank page.
DC (LK) 148675/1
© UCLES 2018

[Turn over

2

www.dynamicpapers.com

Teachers and candidates should read this material prior to the November 2018 examination for 9608
Paper 4.
Reminders
The syllabus states:

•
•

there will be questions on the examination paper which do not relate to this pre-release material
you must choose a high-level programming language from this list:
Visual Basic (console mode)
Python
Pascal / Delphi (console mode)

Note: A mark of zero will be awarded if a programming language other than those listed is used.
The practical skills for Paper 4 build on the practical skills covered in Paper 2. We therefore recommend
that candidates choose the same high-level programming language for this paper as they did for
Paper 2. This will give candidates the opportunity for extensive practice and allow them to acquire
sufficient expertise.
Questions on the examination paper may ask the candidate to write:

•
•
•

structured English
pseudocode
program code

A program flowchart or the use of Jackson Structured Programming should be considered as an
alternative to pseudocode for the documenting of a high-level algorithm design.
Candidates should be confident with:

•
•
•

the presentation of an algorithm using either a program flowchart or pseudocode
the production of a program flowchart from given pseudocode and vice versa
the production of a JSP structure diagram from a given scenario

Candidates will also benefit from using pre-release materials from previous examinations. These are
available on the teacher support site.
Declaration of variables
The syllabus document shows the syntax expected for a declaration statement in pseudocode.
DECLARE <identifier> : <data type>
If Python is the chosen language, each variable’s identifier (name) and its intended data type must be
documented using a comment statement.
Structured English – Variables
An algorithm in pseudocode uses variables, which should be declared. An algorithm in structured
English does not always use variables. In this case, the candidate needs to use the information given
in the question to complete an identifier table. The table needs to contain an identifier, data type and
description for each variable.

© UCLES 2018

9608/41/PRE/O/N/18

www.dynamicpapers.com

3

Key focus:

TASK 1

Object-oriented programming

A computer shop sells different types of computer. Each type of computer performs different tasks.
The shop has a system to store and retrieve key information about the computers, so that customers
can find out more about them.
The program is written using object-oriented programming.

•

The class Computer has the properties:
Code (for example, CMP001)
Width (for example, 20.7)
Height (for example, 16.2)
Weight (for example, 1.3)
Make (for example, ciesoft)
Processor (for example, ZX100)
RAM size (for example, 4GB)
Storage size (for example, 200GB)

•

The class MobilePhone is a type of computer, it has the properties of the Computer class, and:
Camera (for example, TRUE)
3G (for example, TRUE)
4G (for example, FALSE)
Mobile phone network (for example, CIE Mobile)

•

The class Laptop is a type of computer, it has the properties of the Computer class, and:
Touchscreen (for example, FALSE)
Removable screen (for example, TRUE)
Tablet mode (for example, TRUE)
USB 3.0 ports (for example, 2)

TASK 1.1
All of the properties are set to private. Check that you understand the difference between private and
public properties and why programmers use them.

© UCLES 2018

9608/41/PRE/O/N/18

[Turn over

4

www.dynamicpapers.com

TASK 1.2
Draw a class diagram for the Computer, MobilePhone and Laptop classes. Use the following
template to help you with this task.
Make sure you include the appropriate get and set methods.

Key focus:
Defining classes

Computer

MobilePhone

Laptop

TASK 1.3
Check that you understand the meaning of inheritance. The MobilePhone class and Laptop class
inherit from the Computer class.
Add inheritance to your class diagram.

© UCLES 2018

9608/41/PRE/O/N/18

5

www.dynamicpapers.com

TASK 1.4
Write program code to create the Computer class. Make sure:

•
•
•

the properties are declared as private
you have a constructor
you have get and set methods for each property.

TASK 1.5
Write program code to create the MobilePhone and Laptop classes. Make sure:

•
•
•
•

the properties are declared as private
you have a constructor
you have get and set methods for each property
the classes inherit the properties from the Computer class.

TASK 1.6
Add validation (where appropriate) to the constructor and set methods for all three classes. For
example, USB 3.0 ports might be limited to the range 0 to 6.
TASK 1.7
Create instances of the MobilePhone and Laptop classes with appropriate data in the main program.
Store the objects in arrays. To get you started, data for an instance of MobilePhone are as follows:

•
•
•
•
•
•
•
•
•
•
•
•

Code = “MB1”
Width = 6.2
Height = 10.8
Key focus:
Weight = 0.3
Creating instances of classes
Make = “camphones”
Processor = “CIE234X”
RAM size = “2GB”
Storage size = “64GB”
Camera = TRUE
3G = TRUE
4G = TRUE
Key focus:
Mobile Phone Network = “camNetwork”

Using objects in a program

TASK 1.8
Write a procedure to:

•
•
•

prompt a user to input the code for a computer
find the computer with that code
output the information for the computer in an appropriate format.

© UCLES 2018

9608/41/PRE/O/N/18

[Turn over

www.dynamicpapers.com

6

Key focus:
Declarative language

TASK 2

A declarative language is used to create a set of facts and rules for a job agency.
01
02
03
04
05
06
07
08
09
10
11

job_status(sally, employed).
job_status(bill, unemployed).
first_aid_trained(sally).
first_aid_trained(bill).
years_experience(sally, 5).
years_experience(bill, 15).
qualified_as(sally, doctor).
qualified_as(bill, maths_teacher).
job_vacancy(autoshop, mechanic).
job_vacancy(a_school, maths_teacher).
suitable_job(X, Y) IF job_status(X, unemployed) AND qualified_as(X, Z)
AND job_vacancy(Y, Z).

TASK 2.1
Add the following facts:

•
•

Alex is unemployed with 12 years’ experience.
Alex is qualified as a typist and an accountant.

Key focus:

TASK 2.2
Add two more people, and four more job vacancies.

Adding facts

TASK 2.3
State what is returned for the following goals.

•
•
•
•

qualified_as(sally, B)
job_vacancy(X, doctor)
job_vacancy(a_school, art_teacher)
suitable_job(joe, X)

TASK 2.4

Key focus:

Write goals to find the following information.

Writing goals

•
•
•
•
•
•

all people who are employed
all people who are first aid trained
all jobs that one of the people you have added in TASK 2.2 is qualified to do
all job vacancies at a_school
all jobs for a maths teacher
the jobs that Sally and Alex are suitable for

TASK 2.5
An autoshop wants to hire a mechanic, with either at least five years’ experience or who is first aid
trained. Write a goal for this statement.

© UCLES 2018

9608/41/PRE/O/N/18

7

www.dynamicpapers.com

TASK 3
A program uses a record structure, Boat, to store information about boats. The record has the fields:

•
•
•

Boat name (for example, “Mr Boaty”)
Manufacturer (for example, “Camboats”)
Boat type (for example, “1XSC”)

Key focus:
Record structure

TASK 3.1
Use pseudocode to write a definition for the record structure Boat.
TASK 3.2
Write program code to declare your record structure. If you are using Python, you will need to create
a class.
TASK 3.3
Create four boats using your record structure, as separate variables.
TASK 3.4

Key focus:

Amend your program, so the boats are stored in a 1D array.

Storing records

TASK 3.5
Amend the program to allow a user to enter new boats. Each boat should be stored in the array.
TASK 3.6
Amend the program to prompt the user to enter a boat name.
Write a procedure to find and output the information about the boat the user has entered.

© UCLES 2018

9608/41/PRE/O/N/18

8

www.dynamicpapers.com

BLANK PAGE

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 2018

9608/41/PRE/O/N/18

Advertisement