Learn Extracted exam questions A-Level Computer Science 9618 Computer Science June 2025 Question Paper 32
9618 Computer Science June 2025 Question Paper 32
Source PDF on the left, extracted YAML on the right. Compare numbering, marks, options and text.
Data types can be defined using pseudocode.
The composite record data type, \texttt{Departure}, is used to represent flights from Cambridge Airport and is defined in pseudocode as:
\begin{alltt} TYPE Departure DECLARE FlightNumber : STRING DECLARE Destination : STRING DECLARE FlightDate : DATE DECLARE Gate : STRING DECLARE Airline : STRING ENDTYPE \end{alltt}
A variable, \texttt{Flight1}, is declared in pseudocode as:
\begin{alltt} DECLARE Flight1 : Departure \end{alltt}
Write \textbf{pseudocode} to store the following details to \texttt{Flight1}:
\begin{tabular}{|l|l|} \hline \textbf{Field} & \textbf{Data} \ \hline \texttt{FlightNumber} & SB2789 \ \hline \texttt{Destination} & Dublin \ \hline \texttt{FlightDate} & 30/07/2025 \ \hline \texttt{Gate} & N03 \ \hline \texttt{Airline} & Cambridge Airways \ \hline \end{tabular}
The data type for \texttt{Gate} is changed to an enumerated data type, \texttt{GateID}.
Write a \textbf{pseudocode} statement to declare \texttt{GateID} to hold the identity codes for the airport gates:
N01, N02, N03, W01, W02, W03, W04
Write the new \textbf{pseudocode} statement required to replace the declaration of \texttt{Gate} in \texttt{Departure}.
Numbers are stored in a computer using binary floating-point representation with:
\begin{itemize} \item 12 bits for the mantissa \item 4 bits for the exponent \item two's complement form for both the mantissa and the exponent. \end{itemize}
Calculate the normalised binary floating-point representation of $+124.4375$ in this system. Show your working.
\textbf{Mantissa} \qquad\qquad\qquad\qquad\qquad\qquad\qquad \textbf{Exponent}
\framebox{$\square\,\square\,\square\,\square\,\square\,\square\,\square\,\square\,\square\,\square\,\square\,\square$} \qquad \framebox{$\square\,\square\,\square\,\square$}
Calculate the denary value of the following normalised binary floating-point number. Show your working.
\textbf{Mantissa} \qquad\qquad\qquad\qquad\qquad\qquad\qquad \textbf{Exponent}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|} \hline 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 1 \ \hline \end{tabular} \qquad \begin{tabular}{|c|c|c|c|} \hline 0 & 1 & 1 & 0 \ \hline \end{tabular}
Denary value \hrulefill
Identify \textbf{two} different layers of the TCP/IP protocol suite.
Describe how the TCP/IP protocol suite is applied when a message is sent through the internet from one host to another. Do \textbf{not} describe the function of individual layers of the TCP/IP protocol suite.
Circuit switching may be used as a method of data transmission.
State \textbf{two} benefits and \textbf{two} drawbacks of circuit switching.
Benefit 1 \hrulefill
Benefit 2 \hrulefill
Drawback 1 \hrulefill
Drawback 2 \hrulefill
The management and scheduling of processes are tasks carried out by an operating system.
Identify \textbf{three} process states.
- \hrulefill
- \hrulefill
- \hrulefill
Describe the function of the shortest job first scheduling routine \textbf{and} give a benefit of this routine.
Function
Benefit
Describe the structure of a graph as used in an Artificial Intelligence (AI) system.
Explain how supervised learning and unsupervised learning differ from each other.
The diagram shows a logic circuit.
Complete the truth table for the given logic circuit. Show your working.
\begin{tabular}{|c|c|c|c|c|c|c|c|c|} \hline \multicolumn{4}{|c|}{} & \multicolumn{4}{c|}{Working space} & \ \hline \textbf{A} & \textbf{B} & \textbf{C} & \textbf{D} & \textbf{P} & \textbf{Q} & \textbf{R} & \textbf{S} & \textbf{Z} \ \hline 0 & 0 & 0 & 0 & & & & & \ \hline 0 & 0 & 0 & 1 & & & & & \ \hline 0 & 0 & 1 & 0 & & & & & \ \hline 0 & 0 & 1 & 1 & & & & & \ \hline 0 & 1 & 0 & 0 & & & & & \ \hline 0 & 1 & 0 & 1 & & & & & \ \hline 0 & 1 & 1 & 0 & & & & & \ \hline 0 & 1 & 1 & 1 & & & & & \ \hline 1 & 0 & 0 & 0 & & & & & \ \hline 1 & 0 & 0 & 1 & & & & & \ \hline 1 & 0 & 1 & 0 & & & & & \ \hline 1 & 0 & 1 & 1 & & & & & \ \hline 1 & 1 & 0 & 0 & & & & & \ \hline 1 & 1 & 0 & 1 & & & & & \ \hline 1 & 1 & 1 & 0 & & & & & \ \hline 1 & 1 & 1 & 1 & & & & & \ \hline \end{tabular}
Write the Boolean logic expression that corresponds to the given logic circuit as the sum-of-products.
Z = \hrulefill
Use Boolean algebra including De Morgan's laws to simplify the following expression. Show all working.
Simplified expression \hrulefill
Explain what is meant by \textbf{lexical analysis} during program compilation.
Several syntax diagrams are shown.
State why \texttt{9K} is not a valid variable for the given syntax diagrams.
Complete the Backus-Naur Form (BNF) for \texttt{
\texttt{
An expression is defined as follows:
\begin{itemize} \item A variable is assigned to a variable followed by an operator followed by another variable. \item The operator and final variable stage can be repeated as many times as necessary. \end{itemize}
Complete the syntax diagram for an expression.
A character can be a letter or a digit.
An additional constraint has been applied to the definition of variable. It must comply with the given syntax diagram, but it will only pass validation if it has at least \textbf{four} characters.
State \textbf{one} example of a valid variable.
Identify the \textbf{two} main protocols that form Transport Layer Security (TLS) \textbf{and} state the purpose of each.
Protocol 1 \hrulefill Purpose \hrulefill
Protocol 2 \hrulefill Purpose \hrulefill
A linked list of nodes is used to store an ordered list of strings. Each node consists of the data, a left pointer and a right pointer.
The linked list will be organised as a binary tree.
0 is used to represent a null pointer.
Complete the binary tree, including null pointers, to show how the data will be organised after the following strings have been added:
Aa, Mm, Ss, Xx
A binary tree can be used to implement recursion.
Identify \textbf{one} feature of an algorithm that makes it beneficial to use recursion. Give \textbf{one} example of an application that could use a recursive algorithm.
Feature \hrulefill
Example \hrulefill
A medical clinic uses objects of the class \texttt{Patient} to assign a priority and a doctor to a patient. Some of the attributes required in the class are listed in the table.
\begin{tabular}{|l|l|l|} \hline \textbf{Attribute} & \textbf{Data type} & \textbf{Description} \ \hline \texttt{PatientID} & \texttt{STRING} & Unique identifier of the patient \ \hline \texttt{Name} & \texttt{STRING} & Patient's full name, surname first \ \hline \texttt{DoctorID} & \texttt{STRING} & ID of doctor administering treatment \ \hline \end{tabular}
\newline Treatment is prioritised with a numeric scale of 1 to 5.
Complete the class diagram for \texttt{Patient}, to include: \begin{itemize} \item attribute and data type for the date of birth \item attribute and data type for the priority \item methods to assign the patient ID, priority and doctor ID \item methods to return the patient ID, patient date of birth and the priority. \end{itemize}
\begin{alltt} Patient
PatientID : STRING
Name : STRING
....................................................... : ....................................................................
....................................................... : ....................................................................
DoctorID : STRING
................................................................................................................................
SetName(FullName : STRING)
SetDateOfBirth(DOB : DATE)
................................................................................................................................
................................................................................................................................
................................................................................................................................
GetName()
................................................................................................................................
................................................................................................................................
GetDoctorID() \end{alltt}
Identify the object-oriented programming (OOP) term described as ‘an occurrence of an object’.
Describe what is meant by the OOP term \textbf{polymorphism}.
The pseudocode algorithm below uses random file access to copy 50 records from a live file \texttt{CurrentResults.dat} to a stored file \texttt{StoredResults.dat} one record at a time. It uses the user-defined type \texttt{StudentResult}.
\begin{alltt} TYPE StudentResult DECLARE LastName : STRING DECLARE FirstName : STRING DECLARE ExamGrade : STRING ENDTYPE \end{alltt}
If any grades are missing in \texttt{CurrentResults.dat}, the text \texttt{"Missing grade"} is added to the \texttt{ExamGrade} field in \texttt{StoredResults.dat}
Complete this file handling pseudocode algorithm.
\begin{alltt} DECLARE Grade : StudentResult DECLARE Position : INTEGER
\hrulefill
OPENFILE "StoredResults.dat" FOR RANDOM
\hrulefill
SEEK "CurrentResults.dat", Position GETRECORD "CurrentResults.dat", Grade IF Grade.ExamGrade = "" THEN
\hrulefill
ENDIF
\hrulefill
\hrulefill
NEXT Position CLOSEFILE "CurrentResults.dat" CLOSEFILE "StoredResults.dat" \end{alltt}