Cambridge IGCSE · thinka-original Practice Paper

2023 Cambridge IGCSE Computer Science (0478) Practice Paper with Answers

Thinka Nov 2023 (V1) Cambridge IGCSE-Style Mock — Computer Science (0478)

150 marks210 mins2023
An original Thinka practice paper modelled on the structure and difficulty of the Nov 2023 (V1) Cambridge IGCSE Computer Science (0478) paper. Not affiliated with or reproduced from Cambridge.

Paper 11: Computer Systems

Answer all questions. Calculators must not be used. Total marks: 75.
17 Question · 65 marks
Question 1 · short_answer
3 marks
The Von Neumann CPU architecture relies on system buses to connect the central processing unit to main memory. Identify the three system buses and describe the function of each bus.
Show answer & marking scheme

Worked solution

Address Bus carries memory addresses from the CPU to the memory controller to specify where data should be read from or written to. Data Bus carries the actual data or instruction being processed between the CPU, memory, and input/output devices. Control Bus transmits control and timing signals (like read/write commands and clock pulses) from the CPU to manage and coordinate other system components.

Marking scheme

1 mark per correct bus identified along with an accurate description of its role (maximum of 3 marks). - Address Bus: carries memory locations/addresses from CPU to RAM. - Data Bus: carries data/instructions between processor, memory, and I/O devices. - Control Bus: carries control signals/commands (e.g., read, write, clock signals).
Question 2 · short_answer
3 marks
A checksum is a common error detection method used in data transmission. Explain how a checksum is calculated and used to detect errors when transmitting a block of data.
Show answer & marking scheme

Worked solution

Before transmission, the sender runs an algorithm on the block of data to produce a numerical checksum value. This checksum value is appended to the data block and transmitted. Upon receiving the transmission, the receiver runs the same algorithm on the received data block to generate its own checksum value. Finally, the receiver compares the newly generated checksum with the transmitted checksum; any discrepancy indicates that the data was corrupted during transmission.

Marking scheme

Any three from: 1 mark: An algorithm/mathematical formula is applied to the data block to calculate a checksum value prior to transmission. 1 mark: The calculated checksum is sent together with the data. 1 mark: The receiving device applies the same algorithm to the received data to calculate its own checksum. 1 mark: The received checksum is compared with the recalculated checksum. 1 mark: If the two checksum values differ, a transmission error is detected (and retransmission is requested).
Question 3 · short_answer
3 marks
Describe how increasing the resolution and colour depth of a bitmap image affects both its file size and its visual quality.
Show answer & marking scheme

Worked solution

Increasing the resolution means there are more pixels in the bitmap image, which increases the total amount of data to be stored, resulting in a larger file size; visually, it makes the image sharper and more detailed (less pixelation). Increasing the colour depth increases the number of bits allocated to represent the colour of each individual pixel, which also raises the overall file size; visually, it increases the range of available colours, making gradients smoother and the image more lifelike.

Marking scheme

Max 3 marks, with at least 1 mark for file size effects and at least 1 mark for visual quality effects: 1 mark: Larger resolution (more pixels) increases file size. 1 mark: Larger resolution improves image detail / clarity (makes it less pixelated). 1 mark: Higher colour depth (more bits per pixel) increases file size. 1 mark: Higher colour depth increases the range of colours available / reduces colour banding / makes image more realistic.
Question 4 · short_answer
3 marks
Explain how symmetric encryption works to secure data during transmission over a network.
Show answer & marking scheme

Worked solution

Symmetric encryption utilizes a single shared secret key for both encryption and decryption. Before transmitting, the sender uses an encryption algorithm and this shared key to scramble the original plaintext into unreadable ciphertext. The ciphertext is then sent across the network. Upon receipt, the receiver uses the exact same secret key to reverse the algorithm and decrypt the ciphertext back into readable plaintext. If intercepted mid-transit, the data remains secure because it cannot be decrypted without the secret key.

Marking scheme

1 mark: The sender and receiver share a single/identical secret key. 1 mark: The sender uses the key and an encryption algorithm to convert plaintext into ciphertext. 1 mark: The receiver uses the exact same key to decrypt the ciphertext back into plaintext. 1 mark: Intercepted data (ciphertext) cannot be understood/decrypted without possession of the secret key.
Question 5 · Descriptive / Technical explanation
5 marks
A sound engineer is recording an acoustic guitar session. Describe how the acoustic guitar's analogue sound is captured and converted into a digital format by a computer system.
Show answer & marking scheme

Worked solution

The process of converting analogue sound to digital involves the following stages:
1. The acoustic guitar's sound waves are captured by a microphone, which acts as a transducer.
2. The microphone converts these physical sound waves into an analogue electrical signal (varying voltage).
3. This analogue signal is sent to an Analogue-to-Digital Converter (ADC).
4. The ADC samples the amplitude of the analogue wave at regular, predefined time intervals (known as the sampling rate).
5. The measured amplitude at each sample point is converted into a binary value based on the available bit depth (sampling resolution) and stored in memory.

Marking scheme

One mark per valid point up to a maximum of 5 marks:
- Sound waves are detected/captured by a microphone
- Microphone converts sound waves into a continuous analogue electrical signal (voltage)
- Analogue signal is processed by an Analogue-to-Digital Converter (ADC)
- The ADC samples the continuous analogue wave at regular/fixed time intervals (sampling rate)
- The amplitude of the wave is measured at each sample point
- These discrete amplitude values are converted/quantized into binary numbers
Question 6 · Descriptive / Technical explanation
5 marks
A modern tablet computer uses solid-state drive (SSD) flash memory instead of a traditional magnetic hard disk drive. Explain how data is written to and stored in solid-state flash memory.
Show answer & marking scheme

Worked solution

Solid-state storage uses semiconductor chips containing millions of tiny transistors. Specifically, it utilizes NAND flash memory technology.
1. Flash memory consists of arrays of transistors that act as memory cells, which are organized into pages and blocks.
2. These cells are Floating Gate Transistors that can trap and hold an electrical charge.
3. Writing data involves applying a control voltage to force electrons through a thin insulating barrier into the floating gate (tunneling).
4. When electrons are trapped in the floating gate, they block current flow, representing a binary value of 0.
5. When there are no trapped electrons (charge is released), current flows freely, representing a binary value of 1. Because the insulating barrier prevents electrons from escaping, the storage remains non-volatile.

Marking scheme

One mark per valid point up to a maximum of 5 marks:
- Uses NAND flash memory technology / semiconductor chips
- Contains arrays of memory cells made of transistors
- Uses floating gate transistors to store/trap electrical charge
- Insulating oxide layer prevents the trapped electrons from escaping (making it non-volatile)
- Applying a voltage changes the state of the cells (by forcing electrons in/out of the gate)
- The presence or absence of trapped electrons changes the electrical conductivity, representing binary 1 or 0
Question 7 · Descriptive / Technical explanation
5 marks
An automated greenhouse system is designed to manage soil moisture levels for exotic orchids. Describe how a soil moisture sensor, a microprocessor, and a water valve actuator work together to maintain optimal soil moisture levels.
Show answer & marking scheme

Worked solution

The automated feedback loop operates as follows:
1. The soil moisture sensor continuously measures the level of dampness in the soil and outputs a continuous analogue signal.
2. This analogue signal is converted into digital data using an Analogue-to-Digital Converter (ADC) so the microprocessor can understand it.
3. The microprocessor receives the digital value and compares it against pre-set threshold values stored in its memory (representing the optimal range).
4. If the soil moisture level is below the pre-set minimum threshold, the microprocessor sends a digital command signal to the water valve actuator (after converting it to analogue via DAC if necessary) to open the valve and spray water.
5. Once the moisture sensor detects that the moisture level has reached the upper threshold, the microprocessor sends a signal to close the water valve. This is a continuous real-time monitoring loop.

Marking scheme

One mark per valid point up to a maximum of 5 marks:
- Sensor continuously takes physical readings (moisture levels) and outputs analogue data
- Analogue-to-Digital Converter (ADC) converts analogue sensor readings to digital format
- Microprocessor receives digital data and compares it to pre-set / stored values
- If reading is below threshold, microprocessor sends a signal to actuate/open the water valve
- Once reading reaches required target, microprocessor sends a signal to close the valve
- Cycle repeats continuously / real-time feedback loop
Question 8 · Descriptive / Technical explanation
5 marks
A customer is logging into their online banking account via a secure website. Explain how the SSL/TLS handshake protocol establishes a secure, encrypted connection between the customer's web browser and the banking server.
Show answer & marking scheme

Worked solution

The SSL/TLS handshake uses both asymmetric and symmetric encryption to establish security:
1. The client browser initiates the connection by requesting a secure session and sending its supported encryption standards (cipher suites).
2. The banking server responds by sending its SSL/TLS certificate, which contains the server's public key.
3. The browser validates the server's SSL certificate against a trusted Certificate Authority (CA) to confirm the bank's identity.
4. Once verified, the browser generates a temporary symmetric session key, encrypts it using the server's public key (asymmetric encryption), and sends it to the server.
5. The server uses its private key to decrypt the session key. Now, both the browser and server possess the same symmetric session key, which is used to encrypt all subsequent data transmitted during the session.

Marking scheme

One mark per valid point up to a maximum of 5 marks:
- Browser requests secure session and sends cipher capabilities
- Server sends its SSL certificate containing its public key
- Browser validates the server certificate with a trusted Certificate Authority (CA)
- Browser generates a symmetric session key and encrypts it using the server's public key
- Server decrypts the session key using its private key
- Subsequent transaction data is encrypted and decrypted using this shared symmetric session key
Question 9 · Descriptive / Technical explanation
5 marks
A user presses a key on a USB gaming keyboard while the CPU is executing instructions for a demanding physics simulation. Describe how the CPU handles this keypress interrupt without permanently disrupting the execution of the physics simulation.
Show answer & marking scheme

Worked solution

The CPU handles the interrupt through the following process:
1. The keypress generates an electrical interrupt signal, which is transmitted to the CPU.
2. The CPU checks for any pending interrupts at the end of the current Fetch-Decode-Execute cycle.
3. If the keyboard interrupt has a higher priority than the current physics simulation task, the CPU temporarily suspends the execution of the simulation.
4. The current state of the CPU's registers (such as Program Counter and Accumulator) is saved onto a memory stack.
5. The Program Counter is updated with the memory address of the Interrupt Service Routine (ISR) designed to process keypress inputs.
6. Once the ISR completes execution (e.g., registering the key character), the saved register values are loaded back from the stack, allowing the CPU to resume the physics simulation exactly where it left off.

Marking scheme

One mark per valid point up to a maximum of 5 marks:
- Hardware keypress generates an interrupt signal sent to the CPU
- CPU checks for interrupts at the end of every Fetch-Decode-Execute (FDE) cycle
- If priority is high, CPU suspends execution of current task (physics simulation)
- Current register states / PC values are saved onto a stack (or saved in memory)
- CPU loads and runs the Interrupt Service Routine (ISR) to handle the keypress input
- Once ISR is finished, CPU restores saved register states and resumes execution of original task
Question 10 · subjective
4 marks
A remote weather station uses 8-bit registers to store temperature values in binary.

(a) Convert the denary value 89 into an 8-bit binary register. Show your working. [2]

(b) Convert the 8-bit binary register 11001011 into hexadecimal. Show your working. [2]
Show answer & marking scheme

Worked solution

(a) Convert 89 to binary:
- \(89 - 64 = 25\) (place a 1 in the 64 column)
- \(25 - 16 = 9\) (place a 1 in the 16 column)
- \(9 - 8 = 1\) (place a 1 in the 8 column)
- \(1 - 1 = 0\) (place a 1 in the 1 column)
- Columns used: 64, 16, 8, 1.
- 8-bit representation: 01011001.

(b) Convert 11001011 to hexadecimal:
- Split into two 4-bit nibbles: 1100 and 1011.
- 1100 in denary is 12, which represents C in hexadecimal.
- 1011 in denary is 11, which represents B in hexadecimal.
- Hexadecimal value: CB.

Marking scheme

(a) [2 marks total]:
- 1 mark for correct working (e.g. dividing by 2 successively or showing place value subtraction).
- 1 mark for correct binary value (01011001).

(b) [2 marks total]:
- 1 mark for showing correct splitting into nibbles (1100 and 1011) or converting to denary first (203).
- 1 mark for correct hexadecimal value (CB).
Question 11 · subjective
4 marks
An IP address has a block represented by the hexadecimal value A9.

(a) Convert the hexadecimal value A9 into an 8-bit binary number. Show your working. [2]

(b) Convert the hexadecimal value A9 into a denary number. Show your working. [2]
Show answer & marking scheme

Worked solution

(a) Convert A9 to binary:
- Convert individual digits: A = 10, 9 = 9.
- A (10) in 4-bit binary is 1010.
- 9 in 4-bit binary is 1001.
- Combine the nibbles: 10101001.

(b) Convert A9 to denary:
- Multiply the hexadecimal values by their place weights: \(A \times 16^1 + 9 \times 16^0\).
- \(10 \times 16 = 160\).
- \(9 \times 1 = 9\).
- \(160 + 9 = 169\).

Marking scheme

(a) [2 marks total]:
- 1 mark for converting each hexadecimal digit to its 4-bit binary representation (A = 1010, 9 = 1001).
- 1 mark for the correct combined 8-bit binary number (10101001).

(b) [2 marks total]:
- 1 mark for showing correct working (e.g. \(10 \times 16 + 9\) or binary place-value addition).
- 1 mark for correct denary value (169).
Question 12 · subjective
4 marks
A 24-bit RGB color representation system stores a color with the hexadecimal code 3F8E4C.

(a) Convert the middle two hexadecimal digits 8E into an 8-bit binary byte. Show your working. [2]

(b) Convert the last two hexadecimal digits 4C into a denary value. Show your working. [2]
Show answer & marking scheme

Worked solution

(a) Convert 8E to binary:
- 8 in binary (4-bit) is 1000.
- E (14) in binary (4-bit) is 1110.
- Combine them: 10001110.

(b) Convert 4C to denary:
- Multiply the hexadecimal digits by place weights: \(4 \times 16^1 + C \times 16^0\).
- \(4 \times 16 = 64\).
- C represents 12, so \(12 \times 1 = 12\).
- \(64 + 12 = 76\).

Marking scheme

(a) [2 marks total]:
- 1 mark for correct binary representation of either individual digit (8 = 1000 or E = 1110).
- 1 mark for correct combined 8-bit binary byte (10001110).

(b) [2 marks total]:
- 1 mark for showing correct calculation (e.g., \(4 \times 16 + 12\)).
- 1 mark for correct denary value (76).
Question 13 · subjective
4 marks
A computer system register stores the 8-bit binary number 11110011.

(a) Convert this binary number into a denary value. Show your working. [2]

(b) Convert this binary number into a hexadecimal value. Show your working. [2]
Show answer & marking scheme

Worked solution

(a) Convert 11110011 to denary:
- Assign place values: \(128 + 64 + 32 + 16 + 0 + 0 + 2 + 1\).
- Sum the values: \(128 + 64 + 32 + 16 + 2 + 1 = 243\).

(b) Convert 11110011 to hexadecimal:
- Split the binary number into two 4-bit nibbles: 1111 and 0011.
- 1111 in denary is 15, which is F in hexadecimal.
- 0011 in denary is 3, which is 3 in hexadecimal.
- Combine them to get the hexadecimal value: F3.

Marking scheme

(a) [2 marks total]:
- 1 mark for showing correct working (e.g. place values added together or successive calculation).
- 1 mark for correct denary value (243).

(b) [2 marks total]:
- 1 mark for correct binary splitting into 1111 and 0011 or converting to denary first.
- 1 mark for correct hexadecimal value (F3).
Question 14 · Diagram and Annotation
4 marks
Draw and annotate a diagram to demonstrate how the three system buses connect the Central Processing Unit (CPU) and memory. Your diagram should clearly show the names of the buses and the direction of signal or data flow.
Show answer & marking scheme

Worked solution

The diagram must show CPU and Memory as two separate components. There must be three distinct buses connecting them: 1. Address Bus: labeled and drawn with a unidirectional arrow pointing from CPU to Memory. 2. Data Bus: labeled and drawn with a bidirectional arrow showing data transfer in both directions. 3. Control Bus: labeled and drawn with bidirectional arrows to transmit control signals between the CPU, memory, and other components.

Marking scheme

One mark for each correct point up to a maximum of 4: 1. CPU and Memory represented as two separate components. 2. Address bus shown with a unidirectional arrow pointing from CPU to Memory. 3. Data bus shown with a bidirectional arrow between CPU and Memory. 4. Control bus shown with a bidirectional arrow. 5. All three buses correctly named and labeled.
Question 15 · Diagram and Annotation
4 marks
Draw and annotate a diagram to demonstrate how the three system buses connect the Central Processing Unit (CPU) and memory. Your diagram should clearly show the names of the buses and the direction of signal or data flow.
Show answer & marking scheme

Worked solution

The diagram must show CPU and Memory as two separate components. There must be three distinct buses connecting them: 1. Address Bus: labeled and drawn with a unidirectional arrow pointing from CPU to Memory. 2. Data Bus: labeled and drawn with a bidirectional arrow showing data transfer in both directions. 3. Control Bus: labeled and drawn with bidirectional arrows to transmit control signals between the CPU, memory, and other components.

Marking scheme

One mark for each correct point up to a maximum of 4: 1. CPU and Memory represented as two separate components. 2. Address bus shown with a unidirectional arrow pointing from CPU to Memory. 3. Data bus shown with a bidirectional arrow between CPU and Memory. 4. Control bus shown with a bidirectional arrow. 5. All three buses correctly named and labeled.
Question 16 · multiple-choice
2 marks
A processor has an address bus and a data bus. Identify the correct statement about the direction of data transmission on these system buses.
  1. A.The address bus is unidirectional and carries memory addresses from the CPU, while the data bus is bidirectional and carries data to and from CPU registers.
  2. B.The address bus is bidirectional to allow memory location requests, while the data bus is unidirectional to ensure data integrity during writes.
  3. C.Both the address bus and the data bus are unidirectional to prevent interference during simultaneous CPU read and write cycles.
  4. D.Both the address bus and the data bus are bidirectional to allow flexible read and write actions between the CPU and main memory.
Show answer & marking scheme

Worked solution

The address bus is unidirectional because the CPU only sends memory addresses to RAM to indicate where data should be read from or written to. The data bus must be bidirectional to allow data to be transferred in both directions: from RAM to the CPU during a read operation, and from the CPU to RAM during a write operation.

Marking scheme

1 mark: Correctly identifying that the address bus is unidirectional and explaining its direction (from CPU to memory). 1 mark: Correctly identifying that the data bus is bidirectional and explaining its direction (to and from CPU/memory).
Question 17 · multiple-choice
2 marks
Which statement correctly describes how a checksum is used to detect errors during data transmission?
  1. A.The sender calculates a checksum value based on the data block being sent, which is transmitted with the data; the receiver performs the same calculation on the received data and compares the two values.
  2. B.The sender adds a single bit to the end of each byte to ensure the total number of 1-bits is always odd; the receiver checks this count for each byte.
  3. C.The receiver transmits a copy of the received data back to the sender; the sender compares the original data with the returned copy to find discrepancies.
  4. D.The sender uses a timer to wait for a positive acknowledgment from the receiver; if the acknowledgment does not arrive before a timeout, the data is resent.
Show answer & marking scheme

Worked solution

A checksum involves the sender calculating a value from the payload data block using an algorithm and transmitting this value with the data. The receiver runs the same algorithm on the received data and compares its result with the received checksum value to verify integrity. Option B describes a parity check. Option C describes an echo check. Option D describes automatic repeat query (ARQ).

Marking scheme

1 mark: Identifying the correct operational sequence of a checksum (calculation, transmission, recalculation, comparison). 1 mark: Distinguishing checksum from other syllabus error-detection methods (parity, echo check, and ARQ).

Ready to test yourself?

Turn these notes into exam-style practice. Get unlimited AI questions on this topic with instant marking and explanations.

Practice This Topic

Paper 21: Algorithms, Programming and Logic

Answer all questions. Calculators must not be used. Total marks: 75.
11 Question · 81 marks
Question 1 · multiple-choice
2 marks
A logic circuit is represented by the following logic expression:

\(X = (\text{NOT } A \text{ AND } B) \text{ OR } (\text{NOT } C)\)

Identify the correct set of input values for \(A\), \(B\), and \(C\) that will result in an output of \(X = 0\).
  1. A.\(A = 0\), \(B = 1\), \(C = 1\)
  2. B.\(A = 1\), \(B = 0\), \(C = 0\)
  3. C.\(A = 1\), \(B = 1\), \(C = 1\)
  4. D.\(A = 0\), \(B = 0\), \(C = 0\)
Show answer & marking scheme

Worked solution

For the OR operation to output 0, both sides of the operator must evaluate to 0:
1. \(\text{NOT } C = 0\), which means \(C\) must be 1.
2. \(\text{NOT } A \text{ AND } B = 0\), which means we cannot have \(A = 0\) and \(B = 1\) simultaneously.

Let's evaluate the options with \(C = 1\):
If \(A = 1\), \(B = 1\), and \(C = 1\):
- \(\text{NOT } A = 0\)
- \(\text{NOT } A \text{ AND } B = 0 \text{ AND } 1 = 0\)
- \(\text{NOT } C = \text{NOT } 1 = 0\)
- \(X = 0 \text{ OR } 0 = 0\).
This matches Option C.

Marking scheme

- 1 mark: Correctly identifying that input C must be 1 to make the second term (NOT C) equal to 0.
- 1 mark: Correctly identifying that if A is 1 and B is 1, the first term (NOT A AND B) evaluates to 0, producing a final output of 0.
Question 2 · multiple-choice
2 marks
A database table named `Inventory` contains the following fields: `BookID` (text), `Title` (text), `Price` (real), and `Stock` (integer).

A database developer wants to display only the titles and prices of all books where the stock level is less than 10.

Which structured query language (SQL) statement correctly performs this task?
  1. A.`SELECT Title, Price FROM Inventory WHERE Stock < 10`
  2. B.`SELECT Title, Price WHERE Stock < 10 FROM Inventory`
  3. C.`SELECT * FROM Inventory WHERE Stock < 10`
  4. D.`SELECT Title, Price FROM Inventory HAVING Stock < 10`
Show answer & marking scheme

Worked solution

To select specific fields, we list them directly after the `SELECT` command.
To specify the source table, we use the `FROM` command.
To filter the records, we use the `WHERE` clause.

The correct query is:
`SELECT Title, Price FROM Inventory WHERE Stock < 10`

Marking scheme

- 1 mark: Identifying the correct fields (Title, Price) in the SELECT statement and table source (FROM Inventory).
- 1 mark: Specifying the correct comparison logic and syntax in the WHERE clause (WHERE Stock < 10).
Question 3 · multiple-choice
2 marks
Consider the following pseudocode segment:

```
DECLARE Total, BoxCount, Remainder : INTEGER
Total <- 53
BoxCount <- Total DIV 10
Remainder <- Total MOD 10
```

What are the values stored in the variables `BoxCount` and `Remainder` after this code has been executed?
  1. A.`BoxCount = 5`, `Remainder = 3`
  2. B.`BoxCount = 5.3`, `Remainder = 0.3`
  3. C.`BoxCount = 5`, `Remainder = 0.3`
  4. D.`BoxCount = 53`, `Remainder = 5`
Show answer & marking scheme

Worked solution

- `DIV` is the integer division operator. It calculates how many times one number fits into another as a whole integer: \(53 \text{ DIV } 10 = 5\).
- `MOD` is the modulo division operator. It calculates the integer remainder: \(53 \text{ MOD } 10 = 3\).
Therefore, `BoxCount` contains 5 and `Remainder` contains 3.

Marking scheme

- 1 mark: Correct integer calculation for BoxCount using DIV.
- 1 mark: Correct remainder calculation for Remainder using MOD.
Question 4 · multiple-choice
2 marks
A programmer is writing a validation check for an input variable `Temperature` to ensure it falls within a safe range. The requirements are:

- The value must be greater than or equal to -10.0.
- The value must be less than or equal to 50.0.

Which pseudocode line correctly performs this validation?
  1. A.`IF Temperature >= -10.0 OR Temperature <= 50.0 THEN`
  2. B.`IF Temperature >= -10.0 AND Temperature <= 50.0 THEN`
  3. C.`IF Temperature < -10.0 AND Temperature > 50.0 THEN`
  4. D.`IF Temperature > -10.0 OR Temperature < 50.0 THEN`
Show answer & marking scheme

Worked solution

To check if a value is within a continuous range (inclusive of both boundaries), both conditions must be true simultaneously. Therefore, the logical operator `AND` must be used.
Using `OR` would result in the condition always being true (e.g., a temperature of -20.0 is less than 50.0, so the `OR` check would erroneously accept it).

Marking scheme

- 1 mark: Correctly using comparison operators (>= and <=) for boundary values (-10.0 and 50.0).
- 1 mark: Correctly identifying that AND is the required logical operator to ensure both boundaries are respected.
Question 5 · structured
7 marks
A software developer is creating a program to manage bookings for a local sports hall. The program is developed using the program development life cycle. (a) Identify and describe two different types of test data the developer can use to test the program. [4] (b) State two tasks that are carried out during the design stage of the program development life cycle. [2] (c) Explain why the maintenance stage is necessary after a system has been released. [1]
Show answer & marking scheme

Worked solution

(a) Test data types and descriptions: 1. Normal data: Data that is valid and expected, which should be accepted by the program without error. 2. Abnormal data: Data that is invalid/incorrect, which should be rejected by the program with an appropriate error message. (Boundary or Extreme data are also acceptable). (b) Tasks during the design stage: 1. Creating pseudocode or flowcharts to represent the algorithms. 2. Designing the user interface (such as screens and input forms). (c) Why maintenance is necessary: To fix errors and bugs that were not discovered during the testing stage, or to adapt the software to new user requirements.

Marking scheme

(a) Award 1 mark for each identified type of test data (max 2) and 1 mark for each appropriate description (max 2). Acceptable types: Normal data, Abnormal / Invalid data, Extreme data, Boundary data. (b) Award 1 mark for each valid task (max 2): - Writing pseudocode or drawing flowcharts - Designing input / output screens or user interface - Designing the required database structures / file formats - Creating a test plan / test design. (c) Award 1 mark for a valid explanation of maintenance (max 1): - To fix bugs / errors that were not found during testing (corrective maintenance) - To adapt the program to new requirements or laws (adaptive maintenance) - To add new features or improve performance (perfective maintenance).
Question 6 · structured
7 marks
A software developer is creating a program to manage bookings for a local sports hall. The program is developed using the program development life cycle. (a) Identify and describe two different types of test data the developer can use to test the program. [4] (b) State two tasks that are carried out during the design stage of the program development life cycle. [2] (c) Explain why the maintenance stage is necessary after a system has been released. [1]
Show answer & marking scheme

Worked solution

(a) Test data types and descriptions: 1. Normal data: Data that is valid and expected, which should be accepted by the program without error. 2. Abnormal data: Data that is invalid/incorrect, which should be rejected by the program with an appropriate error message. (Boundary or Extreme data are also acceptable). (b) Tasks during the design stage: 1. Creating pseudocode or flowcharts to represent the algorithms. 2. Designing the user interface (such as screens and input forms). (c) Why maintenance is necessary: To fix errors and bugs that were not discovered during the testing stage, or to adapt the software to new user requirements.

Marking scheme

(a) Award 1 mark for each identified type of test data (max 2) and 1 mark for each appropriate description (max 2). Acceptable types: Normal data, Abnormal / Invalid data, Extreme data, Boundary data. (b) Award 1 mark for each valid task (max 2): - Writing pseudocode or drawing flowcharts - Designing input / output screens or user interface - Designing the required database structures / file formats - Creating a test plan / test design. (c) Award 1 mark for a valid explanation of maintenance (max 1): - To fix bugs / errors that were not found during testing (corrective maintenance) - To adapt the program to new requirements or laws (adaptive maintenance) - To add new features or improve performance (perfective maintenance).
Question 7 · Pseudocode Analysis & Trace
10 marks
An algorithm is written in pseudocode to process an array of eight integers:

01 DECLARE Numbers[1:8] OF INTEGER
02 DECLARE MaxSeq, CurrentSeq, Index, PrevValue : INTEGER
03 Numbers[1] <- 12
04 Numbers[2] <- 15
05 Numbers[3] <- 14
06 Numbers[4] <- 18
07 Numbers[5] <- 19
08 Numbers[6] <- 20
09 Numbers[7] <- 11
10 Numbers[8] <- 15
11 MaxSeq <- 1
12 CurrentSeq <- 1
13 PrevValue <- Numbers[1]
14 FOR Index <- 2 TO 8
15 IF Numbers[Index] > PrevValue THEN
16 CurrentSeq <- CurrentSeq + 1
17 IF CurrentSeq > MaxSeq THEN
18 MaxSeq <- CurrentSeq
19 ENDIF
20 ELSE
21 CurrentSeq <- 1
22 ENDIF
23 PrevValue <- Numbers[Index]
24 NEXT Index
25 OUTPUT "Longest run: ", MaxSeq

(a) Complete the trace table for this algorithm. [6]

(b) State the purpose of the algorithm. [2]

(c) Identify how the algorithm could be adapted to find the length of the longest consecutive sequence of strictly decreasing numbers. State the line number and the modified line of pseudocode. [2]
Show answer & marking scheme

Worked solution

(a) The trace table shows the step-by-step changes of each variable inside the loop. The loop iterates from Index 2 to 8. Each time a number is strictly greater than the previous value, CurrentSeq increments, and if it exceeds MaxSeq, MaxSeq is updated. Otherwise, CurrentSeq resets to 1.

(b) The algorithm tracks consecutive elements that are strictly increasing and stores the length of the longest sequence in MaxSeq.

(c) Changing the comparison operator in Line 15 from '>' to '<' ensures that sequences are only tracked when the current value is strictly less than the previous value.

Marking scheme

Part (a) [6 marks]:
- 1 mark for correct Index sequence (2, 3, 4, 5, 6, 7, 8)
- 1 mark for correct values in CurrentSeq (2, 1, 2, 3, 4, 1, 2)
- 1 mark for correct updates in MaxSeq (2, 3, 4 only)
- 1 mark for correct sequence in PrevValue (15, 14, 18, 19, 20, 11, 15)
- 1 mark for correct final output ("Longest run: 4")
- 1 mark for overall layout and no extraneous incorrect entries

Part (b) [2 marks]:
- 1 mark for mentioning finding the length of the longest consecutive run/sequence
- 1 mark for specifying "strictly increasing" numbers

Part (c) [2 marks]:
- 1 mark for identifying Line 15
- 1 mark for the correct line replacement: IF Numbers[Index] < PrevValue THEN
Question 8 · structured
8 marks
A logic circuit has three inputs, A, B and C, and one output, X. The circuit is described as follows: - Input A and input B are the inputs to an OR gate. - The output from this OR gate and input C are the inputs to a NAND gate. - Input C is also the input to a NOT gate. - The output from the NAND gate and the output from the NOT gate are the inputs to an AND gate. - The output from this AND gate is X. (a) Write a logic expression for this logic circuit. Do not attempt to simplify this logic expression. [4] (b) Complete the truth table for the given logic circuit. [4]
Show answer & marking scheme

Worked solution

Part (a): 1. Input A and B go into an OR gate: (A OR B). 2. The output from this OR gate and input C go into a NAND gate: NOT ((A OR B) AND C) or ((A OR B) NAND C). 3. Input C goes into a NOT gate: NOT C. 4. Both outputs are combined using an AND gate: NOT ((A OR B) AND C) AND NOT C. Part (b): Evaluate the expression for all 8 input combinations: Row 1 (0,0,0): NOT ((0 OR 0) AND 0) AND NOT 0 = NOT (0) AND 1 = 1 AND 1 = 1. Row 2 (0,0,1): NOT ((0 OR 0) AND 1) AND NOT 1 = NOT (0) AND 0 = 0. Row 3 (0,1,0): NOT ((0 OR 1) AND 0) AND NOT 0 = NOT (0) AND 1 = 1 AND 1 = 1. Row 4 (0,1,1): NOT ((0 OR 1) AND 1) AND NOT 1 = NOT (1) AND 0 = 0. Row 5 (1,0,0): NOT ((1 OR 0) AND 0) AND NOT 0 = NOT (0) AND 1 = 1. Row 6 (1,0,1): NOT ((1 OR 0) AND 1) AND NOT 1 = NOT (1) AND 0 = 0. Row 7 (1,1,0): NOT ((1 OR 1) AND 0) AND NOT 0 = NOT (0) AND 1 = 1. Row 8 (1,1,1): NOT ((1 OR 1) AND 1) AND NOT 1 = NOT (1) AND 0 = 0.

Marking scheme

Part (a): 4 marks total. - 1 mark for (A OR B) - 1 mark for NOT (... AND C) or (... NAND C) - 1 mark for NOT C - 1 mark for combining both parts with AND to make the correct final expression: X = NOT ((A OR B) AND C) AND NOT C (or equivalent). Part (b): 4 marks total. - 4 marks for all 8 outputs correct (1, 0, 1, 0, 1, 0, 1, 0). - 3 marks for 6 or 7 outputs correct. - 2 marks for 4 or 5 outputs correct. - 1 mark for 2 or 3 outputs correct.
Question 9 · subjective
16 marks
A software developer is designing an algorithm to calculate the total rental cost for a bicycle.

The program requirements are:
* input two values: the rental duration in hours Duration and the hourly rate HourlyRate
* perform a validation check on the duration to ensure that the value is between 1.0 and 12.0 inclusive
* calculate the total cost TotalCost
* output the total cost rounded to two decimal places.

Use the variable names given.

(a) State the name of the validation check. [1]

(b) Write the pseudocode that represents this algorithm, ensuring all validation and processing requirements are met. [6]

(c) Give two different sets of test data for this algorithm and state the purpose of each set. [4]

(d) Complete the headings for the trace table to show a dry-run for this algorithm. You do not need to trace the algorithm. [3]

(e) Describe an improvement that should be made to the requirements for this algorithm. [2]
Show answer & marking scheme

Worked solution

(a) The validation check is a Range Check because it verifies that the input falls within a specified set of boundaries (between 1.0 and 12.0 inclusive).

(b) Example Pseudocode:
```text
START
OUTPUT "Enter the rental duration in hours:"
INPUT Duration
WHILE Duration < 1.0 OR Duration > 12.0
OUTPUT "Invalid duration. Please enter a value between 1.0 and 12.0:"
INPUT Duration
ENDWHILE
OUTPUT "Enter the hourly rental rate:"
INPUT HourlyRate
TotalCost <- Duration * HourlyRate
OUTPUT "The total rental cost is: $", ROUND(TotalCost, 2)
STOP
```

(c) Example Test Data Sets:
* Set 1: Duration = 6.5, HourlyRate = 12.50
* Purpose: Normal test data to ensure that a valid duration and hourly rate are accepted and computed correctly.
* Set 2: Duration = 0.5 (followed by 4.0), HourlyRate = 10.00
* Purpose: Abnormal / Erroneous test data to ensure that values below the lower limit of the range check are rejected, prompting re-entry.
*(Boundary/extreme test data, such as Duration = 1.0 or 12.0, are also acceptable to test the limits of the range check).*

(d) Trace table headings:
* Duration
* HourlyRate
* TotalCost
*(OUTPUT can also be included as a heading)*

(e) A suitable improvement would be to add a validation check for the `HourlyRate` variable. For example, a range check or a simple comparison check to ensure that the hourly rate entered is greater than zero (positive value), preventing errors from negative inputs.

Marking scheme

(a) [1 mark] Award 1 mark for:
- Range check

(b) [6 marks] Award 1 mark for each point up to a maximum of 6 marks:
- Initial input of Duration
- Correct structure of validation loop (e.g., WHILE / REPEAT)
- Correct logical condition for checking limits (Duration < 1.0 OR Duration > 12.0)
- Re-entry of Duration inside validation loop
- Input of HourlyRate
- Correct calculation of TotalCost
- Output of TotalCost rounded to two decimal places (using ROUND)

(c) [4 marks] Award 1 mark for each set of test data and 1 mark for its corresponding purpose:
- Set 1: Any valid duration (1.0 to 12.0) and hourly rate [1]
- Purpose: Normal data to ensure the algorithm accepts it and calculates correctly [1]
- Set 2: Any invalid duration (< 1.0 or > 12.0) [1]
- Purpose: Erroneous/abnormal data to ensure the invalid value is rejected [1]
*(Accept boundary data such as 1.0 or 12.0 with purpose to test extreme limits)*

(d) [3 marks] Award 1 mark for each correct heading up to a maximum of 3 marks:
- Duration
- HourlyRate
- TotalCost
*(Accept OUTPUT)*

(e) [2 marks] Award 1 mark for each point up to a maximum of 2 marks:
- Suggesting validation for HourlyRate [1]
- Describing how this check would work (e.g., ensuring HourlyRate > 0) [1]
Question 10 · structured
10 marks
A local library wants to set up a database to manage the books available for loan. The library wants to store this information about the books:

Field 1 – ISBN number, for example ISBN0987
Field 2 – book title, for example 'Island Adventure'
Field 3 – count of pages, for example 412
Field 4 – replacement price of each book, for example 14.95
Field 5 – if the book is currently on loan, yes or no.

(a) The library requires five fields for each book record. State a suitable name and data type for each of these fields.

Field 1 name: .................................................................................
Data type: .................................................................................
Field 2 name: .................................................................................
Data type: .................................................................................
Field 3 name: .................................................................................
Data type: .................................................................................
Field 4 name: .................................................................................
Data type: .................................................................................
Field 5 name: .................................................................................
Data type: ................................................................................. [5]

(b) (i) Identify which of these fields should be designated as the primary key. [1]

(ii) Justify why this specific field is selected to be the primary key. [1]

(c) Structured query language (SQL) is utilized to search the database. Explain the purpose of each of the following SQL commands:

SELECT .................................................................................

FROM .................................................................................

WHERE ................................................................................. [3]
Show answer & marking scheme

Worked solution

(a)
- Field 1 Name: ISBN (or similar, e.g., ISBNNumber)
- Field 1 Data type: Text / Alphanumeric / String
- Field 2 Name: Title (or similar, e.g., BookTitle)
- Field 2 Data type: Text / Alphanumeric / String
- Field 3 Name: Pages (or similar, e.g., PageCount)
- Field 3 Data type: Integer
- Field 4 Name: Price (or similar, e.g., ReplacementPrice)
- Field 4 Data type: Real / Currency / Decimal / Float
- Field 5 Name: OnLoan (or similar, e.g., LoanStatus)
- Field 5 Data type: Boolean / Yes/No

(b) (i) ISBN (or the name given by the candidate for Field 1)
(b) (ii) It uniquely identifies each book in the database / no two books can have the same ISBN number.

(c)
- SELECT: specifies the fields/columns that will be returned/displayed in the query results.
- FROM: specifies the table(s) from which the query will retrieve the data.
- WHERE: specifies the conditions or search criteria that the records must meet to be selected.

Marking scheme

(a) 1 mark for each correct field name and data type pair:
- Field 1: ISBN (or similar) AND text / alphanumeric / string
- Field 2: Title (or similar) AND text / alphanumeric / string
- Field 3: Pages (or similar) AND integer
- Field 4: Price (or similar) AND real / currency / decimal
- Field 5: OnLoan (or similar) AND Boolean / Yes/No
[Max 5 marks]

(b) (i) 1 mark for:
- ISBN / Field 1 name
[Max 1 mark]

(b) (ii) 1 mark for:
- It acts as a unique identifier (for each record/book)
[Max 1 mark]

(c) 1 mark for each correct explanation of the SQL command:
- SELECT: identifies / lists the fields to be displayed
- FROM: identifies / names the table to be searched
- WHERE: specifies / identifies the search criteria / conditions
[Max 3 marks]
Question 11 · Extended Programming Scenario
15 marks
A secure bicycle parking facility has 5 zones, each containing 20 bicycle racks. Racks can be booked by cyclists using an automated system.

The facility is represented by a two-dimensional (2D) Boolean array called `BicycleRacks[]` containing 5 rows (representing the zones) and 20 columns (representing the racks).

Each element is set to `FALSE` if the rack is vacant (available) and `TRUE` if the rack is occupied.

Cyclists can park up to 5 bicycles at a single time. Racks are allocated sequentially starting from Zone 1, Rack 1 to Zone 5, Rack 20. Users cannot choose specific zones or racks.

The array `BicycleRacks[]` is already declared and contains current occupancy data.

Write a program in pseudocode or program code that meets these specifications:
- counts and outputs the total number of racks currently occupied
- prompts the user to input how many racks they need to reserve
- validates this input to ensure it is an integer between 1 and 5 inclusive
- determines if there are sufficient vacant racks:
- if there are enough vacant racks:
- updates the status of the allocated racks to occupied (`TRUE`)
- outputs the zone number and rack number for each successful allocation
- if there are not enough vacant racks:
- outputs a message displaying the number of racks remaining vacant, or the message 'No Vacant Racks' if the facility is completely occupied.

You must use pseudocode or program code and include comments explaining how your program works.

You do not need to declare or initialise the array `BicycleRacks[]`, but you must assume its indices are 1 to 5 for zones and 1 to 20 for racks. All input and output statements must include clear, user-friendly messages.
Show answer & marking scheme

Worked solution

Below is a complete structured pseudocode solution:

```
// Step 1: Initialise variables and count occupied racks
DECLARE OccupiedCount, VacantCount, NumRequired, Zone, Rack, Allocated : INTEGER
OccupiedCount <- 0

FOR Zone <- 1 TO 5
FOR Rack <- 1 TO 20
IF BicycleRacks[Zone, Rack] = TRUE THEN
OccupiedCount <- OccupiedCount + 1
ENDIF
NEXT Rack
NEXT Zone

OUTPUT "Total bicycle racks currently occupied: ", OccupiedCount
VacantCount <- 100 - OccupiedCount

// Step 2: Request the number of racks needed and validate input
OUTPUT "Enter the number of racks you wish to book (1 to 5): "
INPUT NumRequired
WHILE NumRequired < 1 OR NumRequired > 5 DO
OUTPUT "Error: You can only book between 1 and 5 racks."
OUTPUT "Please enter a valid number: "
INPUT NumRequired
ENDWHILE

// Step 3: Check availability and perform allocation
IF NumRequired > VacantCount THEN
IF VacantCount = 0 THEN
OUTPUT "No Vacant Racks"
ELSE
OUTPUT "Unable to book. Only ", VacantCount, " vacant racks are available."
ENDIF
ELSE
Allocated <- 0
FOR Zone <- 1 TO 5
FOR Rack <- 1 TO 20
// Search and allocate next available racks
IF BicycleRacks[Zone, Rack] = FALSE AND Allocated < NumRequired THEN
BicycleRacks[Zone, Rack] <- TRUE
Allocated <- Allocated + 1
OUTPUT "Successfully booked: Zone ", Zone, ", Rack ", Rack
ENDIF
NEXT Rack
NEXT Zone
ENDIF
```

Marking scheme

Marking scheme is split into AO2 (9 marks) and AO3 (6 marks):

**AO2: Apply knowledge and understanding to a given context (Max 9 marks)**
- **1 mark**: Uses nested loop structure correctly to traverse the 2D array `BicycleRacks`.
- **1 mark**: Correctly checks elements of the 2D array using correct dimensions (Zone index: 1 to 5, Rack index: 1 to 20).
- **1 mark**: Increments an accumulator variable when an occupied rack (`TRUE`) is found, and correctly calculates the remaining vacant racks (e.g., `100 - OccupiedCount`).
- **1 mark**: Outputs the occupied rack count with an appropriate explanatory message.
- **1 mark**: Prompts for input and validates that the integer entered is within the range 1 to 5 inclusive using a logical condition.
- **1 mark**: Uses a loop structure (such as WHILE or REPEAT) for input validation that continues to prompt until a valid value is entered.
- **1 mark**: Uses a logical conditional statement to compare requested allocation against actual available slots.
- **1 mark**: Correctly updates the 2D array values from `FALSE` to `TRUE` to represent new occupancy.
- **1 mark**: Outputs the correct allocated Zone and Rack values in sequence with user-friendly descriptions.

**AO3: Provide solutions to programming problems (Max 6 marks)**
- **1 mark**: Includes descriptive comments explaining the purpose of each key functional block of the program.
- **1 mark**: Uses self-documenting and meaningful identifier names consistently (e.g. `OccupiedCount`, `BicycleRacks`, `Zone`, `Rack`).
- **1 mark**: Program logic avoids overallocation (the allocation process terminates precisely when the requested number of racks has been filled, e.g., checking `Allocated < NumRequired`).
- **1 mark**: Accurately outputs 'No Vacant Racks' if there are zero spaces left, or the exact count of available spaces if the request cannot be fully satisfied.
- **2 marks**: The program is written in a logical order and functions completely as a solution, handling both normal and edge cases smoothly (1 mark if the program contains logical errors that compromise some scenario tasks).

Wondering how well you actually know this?

thinka is an AI practice app for IGCSE & IB students: unlimited questions, instant auto-marking, and detailed step-by-step solutions. 100,000+ students use it to confirm they actually know it, not just think they do.

Want more questions like this? Practice unlimited on thinka, instant answers included.

Start Practicing Free