Computer Science (9608) · May/June 2018 · Question paper 32
Cambridge Computer Science (9608) question paper for paper 32, May/June 2018 — 9608/32/M/J/18, file 9608_s18_qp_32.pdf.
Text of this paper
www.dynamicpapers.com
Cambridge International Examinations
Cambridge International Advanced Subsidiary and Advanced Level
* 3 0 2 0 0 1 4 6 9 0 *
9608/32
COMPUTER SCIENCE
May/June 2018
Paper 3 Advanced Theory
1 hour 30 minutes
Candidates answer on the Question Paper.
No Additional Materials are required.
No calculators allowed.
READ THESE INSTRUCTIONS FIRST
Write your Centre number, candidate number and name in the spaces at the top of this page.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams, graphs or rough working.
Do not use staples, paper clips, glue or correction fluid.
DO NOT WRITE IN ANY BARCODES.
Answer all questions.
No marks will be awarded for using brand names of software packages or hardware.
At the end of the examination, fasten all your work securely together.
The number of marks is given in brackets [ ] at the end of each question or part question.
The maximum number of marks is 75.
This document consists of 12 printed pages.
DC (RW/CT) 151794/4
© UCLES 2018
[Turn over
2
1
www.dynamicpapers.com
Data types can be defined in a programming language.
The data type, StudentRecord, is defined by the code:
TYPE StudentRecord
DECLARE StudentID
DECLARE StudentFirstName
DECLARE StudentSurname
DECLARE StudentDOB
DECLARE StudentCourse
ENDTYPE
:
:
:
:
:
INTEGER
STRING
STRING
DATE
ARRAY[1:10] OF STRING
A variable, CollegeStudent, is declared with the code:
DECLARE CollegeStudent : StudentRecord
(a) Write a pseudocode statement to assign 6539 to the StudentID of CollegeStudent.
[1]
(b) The type definition for StudentRecord is changed.
(i)
Students can take six courses from: Computer Science, Engineering, Science, Maths,
Physics, Chemistry, Music, Drama and English Language.
Rewrite one line from the type definition of StudentRecord to implement the change.
DECLARE
[2]
(ii)
The values for the field StudentID must be between 1 and 8000 inclusive.
Rewrite one line from the type definition of StudentRecord to implement the change.
DECLARE [1]
© UCLES 2018
9608/32/M/J/18
3
www.dynamicpapers.com
(c) A programmer is asked to write a program to process the assessment data for each student.
Students sit one exam in every course they take.
A composite data type, StudentAssessment, needs to be defined with the following three
fields.
•
•
•
a student assessment code (a unique code of three letters and two digits)
the marks for the six exams
the average mark of the six exams
(i)
Write pseudocode to define the data type StudentAssessment.
[4]
(ii)
Data about all students and their assessments are stored in a file that uses random
organisation. The StudentID is used as the key field.
The program allows a user to enter data for a new student.
Explain how the program adds the new data to the file.
[3]
© UCLES 2018
9608/32/M/J/18
[Turn over
www.dynamicpapers.com
4
2
The following syntax diagrams show the syntax of:
•
•
•
•
•
•
an assignment statement
a variable
an unsigned integer
a letter
a digit
an operator
assignment statement
variable
unsigned integer
letter
variable
letter
=
variable
operator
variable
unsigned integer
digit
A
B
C
digit
1
operator
2
-
3
*
4
/
5
© UCLES 2018
+
9608/32/M/J/18
;
5
www.dynamicpapers.com
(a) The following assignment statements are invalid.
Give the reason in each case.
(i)
A
=
B
+
5;
Reason
[1]
(ii)
A
=
B
−
D;
Reason
[1]
(iii)
C4
=
B2 − A1 + C3;
Reason
[1]
(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams shown on the opposite page.
<assignment statement> ::=
<variable> ::=
<unsigned integer> ::=
<operator> ::=
[6]
© UCLES 2018
9608/32/M/J/18
[Turn over
6
www.dynamicpapers.com
(c) The syntax of variable is changed to allow one or more letters followed by an unsigned
integer.
Draw a syntax diagram for the new syntax of the variable.
[3]
3
In a computer system, real numbers are stored using normalised-floating point representation
with:
•
•
•
8 bits for the mantissa
4 bits for the exponent
two’s complement form for both mantissa and exponent.
(a) Calculate the normalised floating-point representation of + 21.75 in this system. Show your
working.
Working
Mantissa
Exponent
[3]
© UCLES 2018
9608/32/M/J/18
7
www.dynamicpapers.com
(b) Find the denary value for the following binary floating-point number.
Mantissa
1
0
1
1
0
Exponent
0
0
0
1
1
1
0
Show your working.
Working
Answer
[3]
4
The TCP/IP protocol suite is used on the Internet.
(a) The table has statements about transmitting data across the Internet.
Put a tick (✓) in each row to identify whether the responsibility belongs to TCP or IP.
Responsibility
TCP
IP
Correct routing
Host to host communication
Communication between networks
Retransmitting missing packets
Reassembling packets into the correct order
[5]
(b) Identify two other internet protocols. State a use for each protocol.
Protocol 1
Use
© UCLES 2018
9608/32/M/J/18
[Turn over
8
www.dynamicpapers.com
Protocol 2
Use
[4]
(c) State the name of the TCP/IP layer that uses IP addresses.
[1]
(d) Emails are transmitted across the Internet using packet switching and routing tables.
(i)
Give four items of data in an IP data packet.
1
2
3
4
[4]
(ii)
Describe two benefits of using packet switching.
Benefit 1
Benefit 2
[4]
(iii)
Give two items of data stored in a routing table.
1
2
[2]
© UCLES 2018
9608/32/M/J/18
9
5
www.dynamicpapers.com
Katarina works for a company specialising in the sale of computer parts and accessories. She
works in the London office and her colleague Lucy works in the Hong Kong office. Katarina emails
confidential information to Lucy so that only Lucy can read the information.
(a) Explain how public and private keys are used to ensure that only Lucy has a readable copy of
the confidential information.
[4]
(b) Julio is buying items from the online shop. He already has an account with the shop.
Explain how the use of Secure Socket Layer (SSL) or Transport Layer Security (TLS) helps to
keep Julio’s confidential information secure.
[3]
(c) The manager of the company is concerned about the threat of malware.
State three vulnerabilities that a malware can exploit.
1
2
3
[3]
© UCLES 2018
9608/32/M/J/18
[Turn over
10
6
www.dynamicpapers.com
(a) There are five scenarios on the left and two types of system on the right.
Draw a line to link each scenario to its correct type of system.
Scenario
System
Car speed display
Aeroplane autopilot
Control
Rollercoaster
Monitoring
Recording the rainfall at
a weather station
Robot loading a part onto
a conveyor belt
[2]
(b) Mary has six fish tanks. The temperature of the water in each tank needs to be within a
specific range.
Identify three items of hardware that Mary can add to her tanks to help maintain the
temperature. Describe the purpose of each item.
Item 1
Purpose
Item 2
Purpose
Item 3
Purpose
[6]
© UCLES 2018
9608/32/M/J/18
11
www.dynamicpapers.com
(c) A temperature reading is taken from each tank once per minute. The temperature reading is
stored as two successive bytes. The format is shown:
Fish tank
7
6
5
4
3
Temperature reading
2
1
0
Byte 1
Byte 2
The fish tank number is indicated by setting one of the bits in Byte 1 to 1. For example, fish
tank number 5 is indicated by setting bit 5 to 1.
Bit 7 of Byte 1 is a flag:
•
•
the flag’s initial value is zero
when the reading has been processed, the flag’s value is set to 1
Bit 0 of Byte 1 is unused.
Byte 2 contains the temperature reading as a two’s complement integer.
(i)
After a temperature reading has been taken, the bytes contain the following data.
7
6
5
4
3
2
1
0
0
0
0
0
1
0
0
0
0
Byte 1
0
0
0
1
0
1
1
Byte 2
Analyse the data contained in the two bytes.
[3]
© UCLES 2018
9608/32/M/J/18
[Turn over
12
(ii)
www.dynamicpapers.com
The system receives a temperature reading of − 2 from fish tank number 4.
Complete the bytes to show the values for this reading after it has been processed.
7
6
5
4
3
2
1
0
Byte 1
Byte 2
[2]
(d) A hardware device to affect the temperature of each tank is on or off depending on the value
of a bit in memory location 6753.
If bit 4 is 1, then the hardware device in fish tank 4 is on.
Write assembly language instructions to set bit 4 of memory location 6753 to 1 without
changing any other bits. Use the instruction set provided.
[3]
Instruction set
Instruction
Op code
Explanation
Operand
LDD
<address>
Direct addressing. Load the contents of the location at the given
address to ACC.
STO
<address>
Store the contents of ACC at the given address.
AND
#n
Bitwise AND operation of the contents of ACC with the operand.
AND
<address>
Bitwise AND operation of the contents of ACC with the contents
of <address>.
XOR
#n
Bitwise XOR operation of the contents of ACC with the operand.
OR
#n
Bitwise OR operation of the contents of ACC with the operand.
OR
<address>
Bitwise OR operation of the contents of ACC with the contents
of <address>.
<address> can be an absolute address or a symbolic address.
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/32/M/J/18