Filters
Year Range
20212025
2021
2022
2024
2025
Difficulty
Session
Variant
Sub-topic
78 questions
Computer Science/Paper 3/Data Representation
CAIEA-Level9618-a · Paper 3

Data Representation

78 questions· page 1 of 8

Q12025 May/Jun·P312 partsEasy
(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

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

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

(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).

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

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

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

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

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

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

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

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

Similar questions
Q22025 May/Jun·P312 partsMedium-Easy
(a)

Write the normalised floating-point representation of the following binary number using this system.

0.00000011010111

(b)

Calculate the normalised binary floating-point representation of –25.3125 in this system.
Show your working.

Working .....................................................................................................................................

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

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

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

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

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

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

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

Similar questions
Q122025 May/Jun·P315MMedium

The pseudocode algorithm checks whether a location in a stock file StockList.dat is empty or not. The location is given by the user. If the location is empty, a suitable message is displayed, otherwise the item stored at that location is displayed.

Complete this file-handling pseudocode algorithm.

DECLARE Location : INTEGER
DECLARE Item : STRING
DECLARE Continue : BOOLEAN
DECLARE Answer : CHAR
Continue ← TRUE

OPENFILE .......................................................................................................................................
WHILE Continue
    OUTPUT "Enter a location between 1 and 500: "
    INPUT Location
    ....................................................................................................................................................
    GETRECORD ..............................................................................................................................
    IF Item = "" THEN
        OUTPUT "This record is missing."
    ELSE
        OUTPUT "The item in stock is ", ........................................................................
    ENDIF
    OUTPUT "Another location (Y or N)?"
    INPUT Answer
    IF Answer <> 'Y' THEN
        Continue ← FALSE
    ENDIF
ENDWHILE
..........................................................................................................................................................
OUTPUT "End of program"
Similar questions
Q12025 May/Jun·P323 partsMedium-Easy
(a)

Write pseudocode to store the following details to Flight1:

FieldData
FlightNumberSB2789
DestinationDublin
FlightDate30/07/2025
GateN03
AirlineCambridge Airways

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

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

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

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

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

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

(b)(i)

Write a pseudocode statement to declare GateID to hold the identity codes for the airport gates:

N01, N02, N03, W01, W02, W03, W04

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

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

(b)(ii)

Write the new pseudocode statement required to replace the declaration of Gate in Departure.

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

Similar questions
Q22025 May/Jun·P322 partsMedium
(a)

Calculate the normalised binary floating-point representation of +124.4375 in this system.
Show your working.

Working .....................................................................................................................................

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

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

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

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

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

(b)

Calculate the denary value of the following normalised binary floating-point number.
Show your working.

Working .....................................................................................................................................

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

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

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

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

Denary value ............................................................................................................................

Similar questions
Q132025 May/Jun·P325MMedium-Easy

The pseudocode algorithm below uses random file access to copy 50 records from a live file CurrentResults.dat to a stored file StoredResults.dat one record at a time. It uses the user-defined type StudentResult.

TYPE StudentResult
  DECLARE LastName : STRING
  DECLARE FirstName : STRING
  DECLARE ExamGrade : STRING
ENDTYPE

If any grades are missing in CurrentResults.dat, the text "Missing grade" is added to the ExamGrade field in StoredResults.dat

Complete this file handling pseudocode algorithm.

DECLARE Grade : StudentResult
DECLARE Position : INTEGER

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

OPENFILE "StoredResults.dat" FOR RANDOM

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

FOR Position ← 1 TO 50
  SEEK "CurrentResults.dat", Position
  GETRECORD "CurrentResults.dat", Grade
  IF Grade.ExamGrade = "" THEN
    .............................................................................................................
  ENDIF 
  ....................................................................................................................
  ....................................................................................................................
NEXT Position
CLOSEFILE "CurrentResults.dat"
CLOSEFILE "StoredResults.dat"
Similar questions
Q12025 May/Jun·P332 partsMedium-Easy
(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.

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

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

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

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

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

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

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

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

(b)

Identify one field in VideoLibrary that could be an efficient enumerated data type and give a reason for your choice.

Field ..........................................................................................................................................

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

Reason .....................................................................................................................................

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

Similar questions
Q22025 May/Jun·P332 partsMedium-Easy
(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.

Denary ......................................................................................................................................

(b)

Calculate the normalised binary floating-point representation of –3.59375 in this system.
Show your working.

Working .....................................................................................................................................

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

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

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

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

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

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

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

Similar questions
Q112025 May/Jun·P335MMedium

The pseudocode algorithm below allows a user to input a new stock item. The random file is searched for the next empty location in the file and the new item is inserted there.
A suitable message is displayed if the file is full.

Complete this pseudocode.

DECLARE Location : INTEGER
DECLARE NewStock : STRING
DECLARE CurrentStock : STRING
DECLARE Stored : BOOLEAN
DECLARE Max : INTEGER
Max ← 100000
Stored ← FALSE
Location ← 1
..........................................................................................................................
OUTPUT "Enter the new item you wish to store: "
INPUT NewStock
WHILE NOT Stored AND Location <= Max
 ....................................................................................................................
 GETRECORD "StockList.dat", ..........................................................................................
 IF CurrentStock = "" THEN
 ...................................................................................... "StockList.dat", NewStock
 Stored ← TRUE
 ELSE
 Location ← Location + 1
 ENDIF
ENDWHILE
................................................................................................................................................ THEN
 OUTPUT "The new item has not been stored as the file was full."
ENDIF
CLOSEFILE "StockList.dat"
Similar questions
Q12025 Oct/Nov·P314 partsEasy
(a)(i)

Write the pseudocode statement to set up a variable for one record of the composite data type, ClubMember.

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

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

(a)(ii)

Write the pseudocode statements to assign the following values to the variable set up in part (a)(i):

  • 984632 to Code
  • TRUE to FeesPaid

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

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

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

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

(b)(i)

Write the pseudocode statement for the type declaration of Activity to hold the names of the available activities:

Badminton, Football, Golf, Snooker, Swimming, Tennis.

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

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

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

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

(b)(ii)

Write the new pseudocode statement required to update the declaration of Choice in the definition of ClubMember.

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

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

Similar questions