Data representation: user-defined types, files and floating point – A Level Computer Science (9618)

60 questions · page 2 of 4

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
16
9618/31/M/J/25 · Question 1May/June 2025Paper 316 marks
Loading question…
Question text

1
A programmer is writing a program to manage bookings for a small taxi company. The programmer
requires some user-defined data types.
(a) Write a pseudocode statement to declare the enumerated data type, Vehicle, to hold the
identity code of each of the company’s taxis:
M100, M230, T101, T102, T120, T150
…
… [2]
(b) Write pseudocode statements to declare the composite data type, Booking, to hold data
about taxi bookings. The data required includes:
•
booking number (any combination of letters and numbers)
•
destination
•
client name
•
client telephone number
•
date of departure
•
address for pick-up
•
the identity code of the taxi used.
Use the most appropriate data type in each case, including the enumerated data type from
part (a).
…
…
…
…
…
…
…
… [4]
ĬÍĊ®Ġ´íÈõÏĪÅĊàù·þ×

17
9618/31/M/J/25 · Question 2May/June 2025Paper 316 marks
Loading question…
Question text

2
Numbers are stored in a computer using binary floating-point representation with:
•
10 bits for the mantissa
•
6 bits for the exponent
•
two’s complement form for both the mantissa and the exponent.
(a) Write the normalised floating-point representation of the following binary number using this
system.
0.00000011010111
Mantissa
Exponent
[2]
(b) Calculate the normalised binary floating-point representation of –25.3125 in this system.
Show your working.
Mantissa
Exponent
Working …
…
…
…
…
…
…
…
[4]
ĬÏĊ®Ġ´íÈõÏĪÅĊàû·þ×

18
9618/32/M/J/25 · Question 1May/June 2025Paper 326 marks
Loading question…
Question text

1
Data types can be defined using pseudocode.
The composite record data type, Departure, is used to represent flights from Cambridge Airport
and is defined in pseudocode as:
TYPE Departure
DECLARE FlightNumber : STRING
DECLARE Destination : STRING
DECLARE FlightDate : DATE
DECLARE Gate : STRING
DECLARE Airline : STRING
ENDTYPE
A variable, Flight1, is declared in pseudocode as:
DECLARE Flight1 : Departure
(a) Write pseudocode to store the following details to Flight1:
Field
Data
FlightNumber
SB2789
Destination
Dublin
FlightDate
30/07/2025
Gate
N03
Airline
Cambridge Airways
…
…
…
…
…
… [3]
(b) The data type for Gate is changed to an enumerated data type, GateID.
(i)
Write a pseudocode statement to declare GateID to hold the identity codes for the
airport gates:
N01, N02, N03, W01, W02, W03, W04
…
… [2]
(ii)
Write the new pseudocode statement required to replace the declaration of Gate in
Departure.
… [1]
ĬÍĊ®Ġ´íÈõÏĪÅĊÞû·þ×

Advertisement
19
9618/32/M/J/25 · Question 2May/June 2025Paper 326 marks
Loading question…
Question text

2
Numbers are stored in a computer using binary floating-point representation with:
•
12 bits for the mantissa
•
4 bits for the exponent
•
two’s complement form for both the mantissa and the exponent.
(a) Calculate the normalised binary floating-point representation of +124.4375 in this system.
Show your working.
Mantissa
Exponent
Working …
…
…
…
…
…
[3]
(b) Calculate the denary value of the following normalised binary floating-point number.
Show your working.
Mantissa
Exponent
1
0
1
0
0
0
1
0
1
0
1
1
0
1
1
0
Working …
…
…
…
…
Denary value …
[3]
ĬÏĊ®Ġ´íÈõÏĪÅĊÞù·þ×

20
9618/33/M/J/25 · Question 1May/June 2025Paper 336 marks
Loading question…
Question text

1
A programmer is writing a program to manage a video library. They require a user-defined data
type.
(a) Write pseudocode statements to declare the composite data type VideoLibrary to hold
data about each video in the collection. This data includes:
•
identity code (any combination of letters and numbers)
•
title
•
year released
•
date purchased
•
format (for example DVD, Blu-ray, 4K, MP4)
•
running time (minutes)
Use the most appropriate data type in each case.
…
…
…
…
…
…
…
… [4]
(b) Identify one field in VideoLibrary that could be an efficient enumerated data type and give
a reason for your choice.
Field …
…
Reason …
…
[2]
ĬÍĊ®Ġ´íÈõÏĪÅĊÝú·þ×

21
9618/33/M/J/25 · Question 2May/June 2025Paper 336 marks
Loading question…
Question text

2
Numbers are stored in a computer using binary floating-point representation with:
•
8 bits for the mantissa
•
8 bits for the exponent
•
two’s complement form for both the mantissa and the exponent.
(a) Give the largest normalised positive two’s complement binary number that can be stored in
this system and state its denary equivalent.
The denary answer should be expressed in terms of powers of 2.
Mantissa
Exponent
Denary …
[2]
(b) Calculate the normalised binary floating-point representation of –3.59375 in this system.
Show your working.
Mantissa
Exponent
Working …
…
…
…
…
…
…
…
[4]
ĬÏĊ®Ġ´íÈõÏĪÅĊÝü·þ×

22
9618/31/O/N/24 · Question 1Oct/Nov 2024Paper 316 marks
Loading question…
Question text

1
Numbers are stored in a computer using binary floating-point representation with:
•
10 bits for the mantissa
•
6 bits for the exponent
•
two’s complement form for both the mantissa and the exponent.
(a) Calculate the normalised binary floating-point representation of +201.125 in this system.
Show your working.
Mantissa
Exponent
Working …
…
…
…
…
…
[3]
(b) Calculate the denary value of the given normalised binary floating-point number.
Show your working.
Mantissa
Exponent
1
0
1
0
1
1
0
0
1
1
0
0
0
1
0
1
Working …
…
…
…
…
…
Answer …
[3]
ĬÍĊ®Ġ´íÈõÏĪÅĊÞü¸þ×

23
9618/31/O/N/24 · Question 5Oct/Nov 2024Paper 315 marks
Loading question…
Question text

5
(a) Explain what is meant by a hashing algorithm in the context of file access.
…
…
…
…
…
… [3]
(b) The use of a hashing algorithm can result in the same storage location being identified for
more than one record.
Outline two methods of overcoming this issue.
1 …
…
2 …
…
[2]
ĬÍĊ®Ġ´íÈõÏĪÅĊàü¸Ā×

Advertisement
24
9618/31/O/N/24 · Question 6Oct/Nov 2024Paper 317 marks
Loading question…
Question text

6
(a) Describe the user-defined data type set.
…
…
…
…
…
… [3]
(b) Write pseudocode statements to declare the set data type, SymbolSet, to hold the following
set of mathematical operators, using the variable Operators.
+
–
*
/
^
…
…
…
…
…
…
…
… [4]
ĬÏĊ®Ġ´íÈõÏĪÅĊàú¸Ā×

25
9618/32/O/N/24 · Question 2Oct/Nov 2024Paper 323 marks
Loading question…
Question text

2
(a) Describe serial file organisation as a method of storing data records in a file.
…
…
…
… [2]
(b) State one example of a use for serial file organisation.
…
… [1]
ĬÍĊ®Ġ´íÈõÏĪÅĊÞû·þ×

26
9618/32/O/N/24 · Question 3Oct/Nov 2024Paper 327 marks
Loading question…
Question text

3
(a) Describe the user‑defined data type record.
…
…
…
…
…
… [3]
(b) A programmer defines a record, Order, to store the following data:
•
account number
•
order number
•
order price
•
order date.
Write pseudocode statements to define this record.
…
…
…
…
…
…
…
… [4]
ĬÏĊ®Ġ´íÈõÏĪÅĊÞù·þ×

27
9618/32/O/N/24 · Question 4Oct/Nov 2024Paper 326 marks
Loading question…
Question text

4
Numbers are stored in a computer using binary floating‑point representation with:
•
12 bits for the mantissa
•
4 bits for the exponent
•
two’s complement form for both the mantissa and the exponent.
(a) Calculate the denary value of the given normalised binary floating‑point number.
Show your working.
Mantissa
Exponent
1
0
0
0
1
1
1
0
1
1
1
0
1
1
1
0
Working …
…
…
Answer …
[2]
(b) Calculate the normalised binary floating‑point representation of – 49.1875 in this system.
Show your working.
Mantissa
Exponent
Working …
…
…
…
…
…
…
…
[4]
ĬÍĊ®Ġ´íÈõÏĪÅĊàû·Ā×

28
9618/33/O/N/24 · Question 1Oct/Nov 2024Paper 336 marks
Loading question…
Question text

1
Numbers are stored in a computer using binary floating-point representation with:
•
10 bits for the mantissa
•
6 bits for the exponent
•
two’s complement form for both the mantissa and the exponent.
(a) Calculate the normalised binary floating-point representation of +201.125 in this system.
Show your working.
Mantissa
Exponent
Working …
…
…
…
…
…
[3]
(b) Calculate the denary value of the given normalised binary floating-point number.
Show your working.
Mantissa
Exponent
1
0
1
0
1
1
0
0
1
1
0
0
0
1
0
1
Working …
…
…
…
…
…
Answer …
[3]
ĬÍĊ®Ġ´íÈõÏĪÅĊÝù¸þ×

Advertisement
29
9618/33/O/N/24 · Question 5Oct/Nov 2024Paper 335 marks
Loading question…
Question text

5
(a) Explain what is meant by a hashing algorithm in the context of file access.
…
…
…
…
…
… [3]
(b) The use of a hashing algorithm can result in the same storage location being identified for
more than one record.
Outline two methods of overcoming this issue.
1 …
…
2 …
…
[2]
ĬÍĊ®Ġ´íÈõÏĪÅĊßù¸Ā×

30
9618/33/O/N/24 · Question 6Oct/Nov 2024Paper 337 marks
Loading question…
Question text

6
(a) Describe the user-defined data type set.
…
…
…
…
…
… [3]
(b) Write pseudocode statements to declare the set data type, SymbolSet, to hold the following
set of mathematical operators, using the variable Operators.
+
–
*
/
^
…
…
…
…
…
…
…
… [4]
ĬÏĊ®Ġ´íÈõÏĪÅĊßû¸Ā×

Advertisement