An original Thinka practice paper modelled on the structure and difficulty of the Jun 2025 (V3) Cambridge IGCSE Computer Science (0478) paper. Not affiliated with or reproduced from Cambridge.
Paper 1 Theory (Computer Systems)
Answer all questions. Calculators must not be used. Total marks: 75.
31 Question · 68 marks
Question 1 · Recall and Short Answer
1.5 marks
A computer network uses hexadecimal values to represent color codes. Convert the hexadecimal color value 2E into an 8-bit binary number. Show your working.
Show answer & marking schemeHide answer & marking scheme
Worked solution
To convert 2E to binary, convert each hexadecimal digit separately: 2 in hex is 0010 in binary. E in hex (which represents 14 in denary) is 1110 in binary. Combine these together to form the 8-bit binary string: 00101110.
Marking scheme
0.5 marks for converting 2 to 0010. 0.5 marks for converting E to 1110. 0.5 marks for combining both digits correctly to write the final 8-bit binary number (00101110).
Question 2 · Recall and Short Answer
1.5 marks
Identify one hardware-generated interrupt and state how the CPU knows an interrupt has occurred.
Show answer & marking schemeHide answer & marking scheme
Worked solution
A hardware interrupt can be triggered by external hardware such as a printer being out of paper or a key being pressed on a keyboard. The CPU is notified of this because it checks the interrupt register (or flag) at the end of every instruction execution cycle to see if an interrupt signal has been flagged.
Marking scheme
0.5 marks for a valid hardware-generated interrupt. 1.0 mark for explaining that the CPU continuously polls or checks the interrupt register/flag at the end of each instruction cycle.
Question 3 · Recall and Short Answer
1.5 marks
An automated smart greenhouse uses a sensor and an actuator to control the soil moisture levels. State the role of the actuator in this system and explain why an analogue-to-digital converter (ADC) is required.
Show answer & marking schemeHide answer & marking scheme
Worked solution
The actuator receives commands from the microprocessor to physically alter the environment, such as opening a valve or turning on a water pump to water the plants. An ADC is necessary because the soil moisture sensor outputs continuously varying analogue signals, whereas the microprocessor can only interpret discrete digital binary data (1s and 0s).
Marking scheme
0.5 marks for stating a correct physical control action of the actuator (e.g., turning on/off water pump). 1.0 mark for explaining that the ADC translates analogue sensor signals into digital format for computer/microprocessor processing.
Question 4 · Recall and Short Answer
1.5 marks
Describe the purpose of the Program Counter (PC) register in the Von Neumann architecture, and state what happens to its value immediately after an instruction is fetched.
Show answer & marking schemeHide answer & marking scheme
Worked solution
The Program Counter (PC) is a dedicated register that stores the memory location of the next instruction that the CPU needs to retrieve. As soon as the current instruction is fetched from memory and sent to the Instruction Register, the PC automatically increments by 1 to point to the next instruction in sequence.
Marking scheme
1.0 mark for describing the purpose of the Program Counter (storing the address of the next instruction to be fetched). 0.5 marks for stating that the value of the PC is incremented by 1.
Question 5 · Recall and Short Answer
1.5 marks
Explain how a checksum is used to detect transmission errors in a block of data.
Show answer & marking schemeHide answer & marking scheme
Worked solution
A checksum works by calculating a numerical value (the sum) from the block of data before transmission using a predefined algorithm. This value is appended to the payload. Upon receipt, the destination computer recalculates the checksum using the same algorithm. If the calculated checksum matches the received checksum, the data is assumed correct; otherwise, a transmission error has occurred.
Marking scheme
0.5 marks for stating that the sender computes a sum of the data bytes and transmits it with the data. 1.0 mark for explaining that the receiving system recalculates the sum and compares both values to identify discrepancies.
Question 6 · Recall and Short Answer
1.5 marks
Describe how a firewall helps protect a local network from unauthorized external access, and list one parameter it checks.
Show answer & marking schemeHide answer & marking scheme
Worked solution
A firewall sits between an internal private network and external public networks. It acts as a barrier, inspecting all incoming and outgoing data packets and determining whether to allow or block them based on configured security criteria. One common parameter it examines is the source IP address of the incoming traffic.
Marking scheme
1.0 mark for describing the traffic monitoring and filtering based on user-defined/preset security rules. 0.5 marks for listing a valid checked parameter (accept: IP address, port number, protocol type, packet contents/metadata).
Question 7 · Recall and Short Answer
1.5 marks
State two physical or operational differences between a Solid State Drive (SSD) and a Hard Disk Drive (HDD).
Show answer & marking schemeHide answer & marking scheme
Worked solution
SSDs are entirely electronic and use semiconductor flash memory chips to hold data, making them silent and less susceptible to mechanical damage. HDDs, on the other hand, rely on mechanical moving components, specifically spinning magnetic platters and actuator arms with read/write heads that scan the platters.
Marking scheme
0.75 marks for each distinct, valid comparison (maximum of 1.5 marks). Accept comparisons based on: physical moving parts vs. solid-state, magnetic storage vs. flash memory/silicon chips, durability, or power consumption.
Question 8 · Recall and Short Answer
1.5 marks
Define the term "foreign key" in a relational database, and explain why it is used.
Show answer & marking schemeHide answer & marking scheme
Worked solution
In a relational database, a foreign key is an attribute (or collection of attributes) in one table that acts as a reference to the primary key in a different table. It is used to establish and enforce a link between the data in the two tables, which ensures referential integrity by preventing orphaned records.
Marking scheme
0.5 marks for defining a foreign key as a primary key in another table. 1.0 mark for explaining that it is used to establish relationships between tables and maintain referential integrity.
Question 9 · Recall and Short Answer
1.5 marks
State one reason why computer scientists use hexadecimal to represent binary values, and calculate the total number of nibbles in 3 bytes of data.
Show answer & marking schemeHide answer & marking scheme
Worked solution
Hexadecimal is used because it is much more compact than binary, making it easier for human programmers to read, write, and debug, which reduces transcription errors. Since one byte consists of 8 bits and one nibble consists of 4 bits, there are exactly 2 nibbles in a byte. Therefore, 3 bytes multiplied by 2 nibbles per byte equals 6 nibbles.
Marking scheme
1 mark for any valid reason why hexadecimal is used (e.g., easier for humans to read/write, more compact, reduces transcription errors). 0.5 marks for the correct number of nibbles (6).
Question 10 · Recall and Short Answer
1.5 marks
Describe the primary function of the Program Counter (PC) register during the fetch stage of the fetch-decode-execute cycle.
Show answer & marking schemeHide answer & marking scheme
Worked solution
During the fetch stage, the Program Counter (PC) holds the memory address of the next instruction that needs to be fetched from main memory. Once this address is sent to the Memory Address Register (MAR), the PC is automatically incremented by 1 so that it points to the address of the next sequential instruction to be executed.
Marking scheme
1 mark for stating that it holds/stores the address of the next instruction to be fetched. 0.5 marks for stating that it is incremented (by 1) after the address is sent.
Question 11 · Recall and Short Answer
1.5 marks
Explain why parallel data transmission is more susceptible to data skewing than serial data transmission.
Show answer & marking schemeHide answer & marking scheme
Worked solution
Parallel data transmission uses multiple wires to send several bits of data simultaneously. Because each wire can have slightly different physical and electrical properties, the individual bits may travel at marginally different speeds and arrive at the destination out of sync (data skewing). Serial transmission sends bits sequentially along a single wire, meaning skewing cannot occur because all bits follow the same path one after another.
Marking scheme
1 mark for explaining that parallel transmission uses multiple wires and bits can arrive at different times/out of sync due to differing physical/electrical properties. 0.5 marks for explaining that serial transmission uses a single wire, preventing bits from arriving out of order.
Question 12 · Recall and Short Answer
1.5 marks
An echo check is a method used to detect transmission errors. Describe how an echo check works, and state one disadvantage of using this method.
Show answer & marking schemeHide answer & marking scheme
Worked solution
When using an echo check, the sender transmits a block of data to the receiver. Immediately upon receiving the data, the receiver transmits the exact data back to the sender. The sender then compares the echoed data with the original copy. If they do not match, an error is detected, and the data is retransmitted. A major disadvantage is that it consumes twice the bandwidth and is highly inefficient, and if an error occurs on the return journey, an unnecessary retransmission is triggered.
Marking scheme
1 mark for a correct description of the process (data is sent back to the sender, who compares it with the original). 0.5 marks for any valid disadvantage (e.g., inefficient/slow because data is sent twice, errors can occur on the return path causing unnecessary retransmissions).
Question 13 · Recall and Short Answer
1.5 marks
Explain the role of a web browser when a user requests to view a web page hosted on a remote web server.
Show answer & marking schemeHide answer & marking scheme
Worked solution
When a user inputs a URL, the web browser requests the web page files from the remote web server. Once the server sends back the files (such as HTML, CSS, and JavaScript), the browser interprets and translates this code to render the page visually so that the user can interact with it.
Marking scheme
1 mark for describing the retrieval process (sending a request to the server and receiving the web page files/HTML). 0.5 marks for describing the rendering process (interpreting/translating the code into a user-friendly display).
Question 14 · Recall and Short Answer
1.5 marks
Automated greenhouse systems use sensors to monitor conditions. Describe the role of an actuator in such a system, and identify one specific example of an actuator that would be used in a greenhouse.
Show answer & marking schemeHide answer & marking scheme
Worked solution
In an automated system, the microprocessor processes sensor data and sends control signals to output devices. An actuator is a hardware component that receives these electrical signals and converts them into physical actions (such as rotary or linear movement). In a greenhouse, a typical actuator would be a motor used to open a window vent, a water pump to irrigate plants, or a switch to turn on a heater.
Marking scheme
1 mark for describing the role of an actuator (converts electrical signals from a microprocessor into physical movement/action). 0.5 marks for a correct greenhouse-specific example (e.g., vent motor, water pump, heater switch, fan).
Question 15 · Recall and Short Answer
1.5 marks
Define what is meant by an interrupt in a computer system, and state one reason why an interrupt would be generated by a printer hardware device.
Show answer & marking schemeHide answer & marking scheme
Worked solution
An interrupt is a signal sent to the processor from a hardware device or software program that temporarily suspends the current CPU tasks so that the processor can handle the urgent request (via an Interrupt Service Routine). A printer would generate a hardware interrupt to notify the processor of an issue requiring user intervention, such as running out of paper, encountering a paper jam, or running out of ink.
Marking scheme
1 mark for defining an interrupt (a signal sent to the processor requesting attention/suspending current execution). 0.5 marks for a valid printer interrupt reason (e.g., out of paper, paper jam, low ink, printer offline).
Question 16 · Recall and Short Answer
1.5 marks
Explain the purpose of a primary key in a database table, and state why a person's surname is not suitable to be chosen as a primary key.
Show answer & marking schemeHide answer & marking scheme
Worked solution
A primary key is a field in a database table that uniquely identifies each individual record (or row) in that table, ensuring that no two records are identical. A person's surname is entirely unsuitable as a primary key because it is not unique; in any moderately sized database, there is a very high probability that multiple distinct individuals will share the exact same surname.
Marking scheme
1 mark for explaining the purpose of a primary key (uniquely identifies a record/row). 0.5 marks for explaining why surname is unsuitable (it is not unique / multiple people can have the same surname).
Question 17 · Recall and Short Answer
2 marks
A software programmer writes a computer program in a high-level language. This code needs to be translated into machine code before it can be executed.
Identify two differences between the way a compiler translates a program and the way an interpreter translates a program.
Show answer & marking schemeHide answer & marking scheme
Worked solution
1. Compilation translates the whole high-level program at once, while interpretation translates and executes it line-by-line. 2. Compilers produce a separate executable file (machine code), meaning the translator is no longer needed to run the program. Interpreters do not produce an executable, so the interpreter must be present during run-time. 3. Errors are compiled into a report at the end of compilation, whereas an interpreter halts execution at the specific line containing the error.
Marking scheme
One mark per correct difference, up to a maximum of two marks: - Compiler translates the whole program at once // interpreter translates line-by-line [1] - Compiler produces an executable file // interpreter does not produce an executable file [1] - Compiler reports all errors at the end // interpreter stops at the first error [1] - Compiled program runs faster (once compiled) // interpreted program runs slower [1]
Question 18 · Recall and Short Answer
2 marks
A computer system uses hexadecimal numbers to represent colour codes in graphics software.
Explain two reasons why computer programmers prefer to use hexadecimal rather than binary to represent these values.
Show answer & marking schemeHide answer & marking scheme
Worked solution
1. Hexadecimal representation is much shorter than binary (e.g., 2 hex characters instead of 8 binary bits), which makes it far easier for programmers to read and write. 2. Because the representations are shorter, programmers are much less likely to make mistakes (typing or reading errors) when copying or inputting hex values. 3. Debugging is easier because patterns and values are more easily spotted in hexadecimal than in long strings of ones and zeros.
Marking scheme
One mark per correct explanation, up to a maximum of two marks: - Hexadecimal is shorter / more compact to write / takes up less screen space (than binary) [1] - Hexadecimal is easier for humans to read / write / understand (than binary) [1] - Less chance of errors when copying / typing / inputting the values [1] - Easier / quicker to debug [1] Note: Do not accept 'takes up less memory' or 'stores more data'.
Question 19 · short_answer
2 marks
A temperature sensor in a cold storage unit records a temperature of \(-43^{\circ}\text{C}\).
Convert the denary value \(-43\) into an 8-bit two's complement binary integer. Show your working.
Show answer & marking schemeHide answer & marking scheme
Step 2: Find the two's complement of 00101011. - Invert the bits (one's complement): 11010100 - Add 1: 11010101
Alternatively, using column values: \(-128 + 64 + 16 + 4 + 1 = -43\), which gives the binary representation 11010101.
Marking scheme
1 mark for correct method of working (e.g. converting 43 to binary and inverting the bits and adding 1, or showing calculation using column headings with -128). 1 mark for correct 8-bit binary representation: 11010101.
Question 20 · short_answer
2 marks
A microcontroller adds two 8-bit registers containing unsigned binary integers: `01101100` and `10100110`.
Add the two 8-bit binary numbers. State whether an overflow error has occurred and give a reason for your answer.
Show answer & marking schemeHide answer & marking scheme
Worked solution
Perform binary addition: ``` 01101100 + 10100110 ---------- 100010010 ``` Since the result is a 9-bit number, the stored result in an 8-bit register is `00010010`. An overflow error has occurred because the result requires 9 bits to be represented, and the ninth bit (the carry out from the MSB) cannot fit in the 8-bit register.
Marking scheme
1 mark for correct binary sum (00010010). 1 mark for stating that an overflow error occurred because the sum exceeds 8 bits / requires 9 bits / the final carry-out bit cannot be stored.
Question 21 · short_answer
1 marks
An 8-bit binary register stores the value `00111000`.
A logical left shift of 3 places is performed on this register.
Give the binary number stored after the logical left shift has taken place.
Show answer & marking schemeHide answer & marking scheme
Worked solution
Original binary: `00111000` - Shift left by 1: `01110000` - Shift left by 2: `11100000` - Shift left by 3: `11000000`
Marking scheme
1 mark for the correct 8-bit binary number: 11000000.
Question 22 · short_answer
2 marks
A mono sound recording has a sample rate of \(8000\text{ Hz}\), a sample resolution of \(8\text{ bits}\), and lasts for \(30\text{ seconds}\).
Calculate the file size of the audio file in kilobytes (kB). Show all of your working.
Show answer & marking schemeHide answer & marking scheme
Worked solution
Step 1: Calculate the size of the recording in bits. \(8000\text{ Hz} \times 8\text{ bits} \times 30\text{ seconds} \times 1\text{ channel} = 1\,920\,000\text{ bits}\)
Step 3: Convert bytes to kilobytes (kB) using the denary scale. \(240\,000 / 1000 = 240\text{ kB}\)
Marking scheme
1 mark for correct working to find the size in bytes (i.e. \(8000 \times 30\) or 240,000 bytes). 1 mark for the correct final answer: 240 (kB).
Question 23 · short_answer
2 marks
A color code in a CSS stylesheet is represented in hexadecimal as `#A7`.
Convert the hexadecimal value `A7` into a denary number. Show all of your working.
Show answer & marking schemeHide answer & marking scheme
Worked solution
The hexadecimal digits are A and 7. In hexadecimal, A represents the value 10. The base-16 column headings are 16 and 1: \((10 \times 16) + (7 \times 1) = 160 + 7 = 167\).
Marking scheme
1 mark for showing correct working (e.g. converting A to 10 and multiplying by 16, or \(10 \times 16 + 7\)). 1 mark for the correct denary value: 167.
Question 24 · Technical Explanations
3 marks
A software developer is deciding whether to use a check digit or a checksum to verify data integrity. Describe the differences between how a check digit and a checksum are calculated and used.
Show answer & marking schemeHide answer & marking scheme
Worked solution
A check digit is a single digit appended to the end of a identification number (such as an ISBN or barcode) to detect manual entry errors. It is calculated using a specific algorithm (like Modulo-11) on the preceding digits. In contrast, a checksum is calculated by applying an algorithm (such as adding the byte values) to an entire block of binary data before transmission. The receiving device recalculates the checksum and compares it to the transmitted value to verify that no bits were corrupted during transfer.
Marking scheme
Award 1 mark for each point up to a maximum of 3: - 1 mark for stating that a check digit is used for single strings of numbers (e.g. barcodes, ISBNs) typically to detect human data entry errors, whereas a checksum is used for blocks of data/files to detect transmission errors. - 1 mark for explaining the calculation difference (check digit uses an algorithm on a specific sequence of digits; checksum adds or processes all the byte values of a data block). - 1 mark for describing that the calculated value is compared with the received/appended value at the destination to verify data integrity.
Question 25 · Technical Explanations
3 marks
Explain the role of the address bus in a Von Neumann processor and how increasing the width of the address bus affects the overall performance of the computer system.
Show answer & marking schemeHide answer & marking scheme
Worked solution
The address bus is a unidirectional bus that carries signals representing physical memory addresses from the CPU to the RAM (random access memory) to identify where data should be read from or written to. The width of the address bus determines the number of bits used to address memory. Increasing the width from, for example, 32-bit to 64-bit exponentially increases the maximum amount of directly addressable memory locations. This allows more physical RAM to be installed and accessed, which dramatically improves performance by minimizing the usage of slow secondary storage as virtual memory.
Marking scheme
Award 1 mark for each point up to a maximum of 3: - 1 mark: Identifies that the address bus carries memory addresses from the CPU to RAM / memory controller (and is unidirectional). - 1 mark: Explains that increasing the bus width increases the maximum amount of directly addressable memory locations (or words). - 1 mark: Connects larger addressable memory to improved system performance (e.g., allowing more physical RAM to be accessed, which reduces reliance on slow virtual memory/paging).
Question 26 · Technical Explanations
3 marks
Explain how symmetric key encryption is used to secure data stored on a portable hard drive, and describe one security challenge associated with this method if the data needs to be shared with another remote user.
Show answer & marking schemeHide answer & marking scheme
Worked solution
Symmetric key encryption uses the same single secret key for both encrypting and decrypting data. Before the data is written to the portable hard drive, an encryption algorithm uses the key to convert the plaintext data into unreadable ciphertext. To access the data, the same key must be applied to decrypt it. If the owner wants to share this data with a remote user, they face the key distribution problem: the key must be transmitted to the recipient securely. If the key is intercepted during transmission, the security is entirely compromised.
Marking scheme
Award 1 mark for each point up to a maximum of 3: - 1 mark: Explains that symmetric encryption uses a single / the same secret key to both encrypt and decrypt the data. - 1 mark: Explains that plaintext is converted to ciphertext using an encryption algorithm and the key before storage. - 1 mark: Identifies the key distribution/exchange problem as the main challenge (the key must be sent securely to the recipient, and if intercepted, the encrypted data can be decrypted by unauthorized parties).
Question 27 · Technical Explanations
3 marks
A smart irrigation system is used to automatically water crops when soil moisture levels drop. Describe how sensors, a microprocessor, and actuators work together to form a feedback loop in this system.
Show answer & marking schemeHide answer & marking scheme
Worked solution
The feedback loop begins with soil moisture sensors continuously measuring the water levels in the soil. These analogue readings are converted to digital signals (using an ADC) and sent to the microprocessor. The microprocessor compares these real-time values to a pre-set optimal moisture threshold. If the reading is below the threshold, the microprocessor sends a control signal to an actuator (such as a motorized water valve) to turn on the water. As watering occurs, the soil moisture increases. The sensors detect this change and send new readings to the microprocessor, which turns off the actuator once the threshold is met, completing the continuous feedback loop.
Marking scheme
Award 1 mark for each point up to a maximum of 3: - 1 mark: Sensors continuously monitor soil moisture and send data to the microprocessor (after converting analogue to digital via ADC). - 1 mark: Microprocessor compares the digital input against pre-set threshold values and determines if action is needed. - 1 mark: Microprocessor sends signals to actuators (e.g., water valve/pump) to alter the physical state, and this action directly influences subsequent sensor readings (forming the feedback loop).
Question 28 · Technical Explanations
3 marks
Describe the purpose of disk defragmentation software and explain how running this utility improves the read/write performance of a magnetic Hard Disk Drive (HDD).
Show answer & marking schemeHide answer & marking scheme
Worked solution
The purpose of disk defragmentation software is to reorganize files stored on a magnetic hard drive so that all segments/sectors of individual files are stored in contiguous (adjacent) memory locations, rather than scattered across the platters. It also consolidates free space. Running this utility improves HDD performance because when a file is opened, the physical read/write head does not have to move across multiple tracks and sectors to retrieve different parts of the file. This significantly reduces physical drive latency and seek time.
Marking scheme
Award 1 mark for each point up to a maximum of 3: - 1 mark: Explains that defragmentation software rearranges file blocks/sectors so they are stored contiguously (next to each other) on the drive platters. - 1 mark: Identifies that the utility also consolidates/groups the remaining free space together. - 1 mark: Explains that this reduces the physical movement/rotation of the HDD read/write head (reduces seek time), leading to faster file retrieval.
Question 29 · Technical Explanations
3 marks
Explain two reasons why serial data transmission is preferred over parallel data transmission for sending data over long distances.
Show answer & marking schemeHide answer & marking scheme
Worked solution
Serial data transmission sends one bit at a time over a single channel/wire, whereas parallel data transmission sends multiple bits simultaneously over multiple wires. Over long distances, parallel transmission suffers from data skewing, where bits arrive at slightly different times due to physical variations in the wires, rendering the data corrupt. Parallel transmission also suffers from electromagnetic interference (crosstalk) between closely packed wires. Serial transmission eliminates skewing, minimizes crosstalk, and is significantly cheaper to install because it requires much less cabling.
Marking scheme
Award 1 mark for each point up to a maximum of 3: - 1 mark: Explains that parallel transmission suffers from data skewing (bits arriving out of sync over distance), which does not happen in serial transmission. - 1 mark: Explains that serial transmission has minimal crosstalk/interference because it uses fewer wires, unlike parallel which suffers from signal degradation between adjacent lines. - 1 mark: Mentions that serial transmission is more cost-effective/cheaper to manufacture and install over long distances due to using only a single physical pathway.
Question 30 · Diagramming & Flow mapping
6 marks
A user securely connects to a banking website using HTTPS. The secure connection is established using the SSL/TLS handshake protocol.
(a) Complete the flow diagram of the SSL/TLS handshake by matching the step numbers (1 to 4) with the correct descriptions.
Descriptions: A - The browser verifies the server's certificate against a list of trusted Certificate Authorities. B - The server sends its SSL certificate, which contains the server's public key, to the browser. C - The browser sends a symmetric session key, encrypted with the server's public key, back to the server. D - The browser requests that the server identifies itself and establishes a secure connection.
(b) State two functions of a web browser other than storing cookies or handling the SSL/TLS handshake.
Show answer & marking schemeHide answer & marking scheme
Worked solution
(a) - Step 1 corresponds to description D (the browser initiates the handshake by requesting identification). - Step 2 corresponds to description B (the server responds by providing its digital SSL certificate containing its public key). - Step 3 corresponds to description A (the browser authenticates the certificate against its pre-installed list of trusted CAs). - Step 4 corresponds to description C (the browser generates and sends a session key encrypted with the server's public key to establish the symmetric encryption channel).
(b) Other key browser functions include: - Converting HTML/CSS/JavaScript into a visual interactive webpage for the user. - Providing navigation control tools such as back/forward arrows, home buttons, and refresh options. - Storing search history, managing user bookmarks, and allowing multi-tab browsing.
Marking scheme
(a) [4 marks total] - 1 mark for Step 1: D - 1 mark for Step 2: B - 1 mark for Step 3: A - 1 mark for Step 4: C
(b) [2 marks total] 1 mark for each valid function of a web browser (Max 2): - Translates/renders HTML/CSS/code to display a web page - Storing user bookmarks/favourites - Keeping a history of visited web pages - Allowing multiple tabs to be opened simultaneously - Providing navigation features (back, forward, refresh buttons) - Storing search queries / auto-fill data (Do not accept storing cookies or managing SSL/TLS handshake as they are excluded in the prompt)
Question 31 · Diagramming & Flow mapping
7 marks
The fetch stage of the Fetch–Decode–Execute (FDE) cycle describes the sequence of data and signal flows within the CPU and memory.
Complete the following description of the fetch stage by writing the correct term in each of the numbered blanks (1) to (7).
'The address of the next instruction is first read from the ...(1)... register. This address is then sent to the ...(2)... register via the ...(3)... bus. A read signal is sent by the Control Unit along the ...(4)... bus to memory. The instruction stored at that address in memory is then sent to the ...(5)... register via the ...(6)... bus. Finally, the instruction is copied to the Current Instruction Register (CIR) for decoding, and the Program Counter is ...(7)... to point to the next instruction.'
Show answer & marking schemeHide answer & marking scheme
Worked solution
The logical sequence of events in the fetch stage of the FDE cycle is: 1. The program counter (PC) holds the address of the next instruction to fetch. 2. This address is copied to the memory address register (MAR) via the Address Bus. 3. A read request signal is generated by the Control Unit and sent over the Control Bus. 4. Memory returns the instruction located at the specified address back to the memory data register (MDR) via the Data Bus. 5. Simultaneously, the Program Counter (PC) is incremented (increased by 1) so it holds the address of the subsequent instruction. 6. The fetched instruction is then loaded into the Current Instruction Register (CIR) to prepare it for decoding.
Marking scheme
1 mark for each correct term: (1) Program Counter / PC (2) Memory Address Register / MAR (3) Address (bus) (4) Control (bus) (5) Memory Data Register / MDR (accept Memory Buffer Register / MBR) (6) Data (bus) (7) incremented / incremented by 1 / increased / added to
Ready to test yourself?
Turn these notes into exam-style practice. Get unlimited AI questions on this topic with instant marking and explanations.
Identify the correct labels or statements that should be placed in: (i) Decision Box [A] (ii) Decision Box [B] (iii) Process Box [C] (iv) Process Box [D] (v) The step to which Process Box [C] and Process Box [D] must loop back to (Label [E])
Show answer & marking schemeHide answer & marking scheme
Worked solution
(i) Decision Box [A] checks for the termination sentinel value, which is -1. Thus: Weight = -1. (ii) Decision Box [B] checks if the weight is within the allowed limit of 23 kg. Thus: Weight <= 23. (iii) Process Box [C] increments the AllowedCount when the condition in [B] is met (Yes branch). Thus: AllowedCount ← AllowedCount + 1. (iv) Process Box [D] increments the OverweightCount when the condition in [B] is not met (No branch). Thus: OverweightCount ← OverweightCount + 1. (v) After processing a bag, the control flow must loop back to input the next bag's weight, which is the 'INPUT Weight' step.
Marking scheme
1 mark for each correct identification: - (i) Weight = -1 (accept equivalent logical checks like Weight == -1) - (ii) Weight <= 23 (accept Weight < 24) - (iii) AllowedCount ← AllowedCount + 1 (accept AllowedCount = AllowedCount + 1) - (iv) OverweightCount ← OverweightCount + 1 (accept OverweightCount = OverweightCount + 1) - (v) INPUT Weight / the input step (do not accept loop back to START or AllowedCount ← 0)
Question 2 · structured
5 marks
An algorithm is designed to find and output the highest temperature recorded during a day. Only positive temperatures (greater than 0) are entered. An input of -1 terminates the input process.
An amateur developer draws the following flowchart, but it contains 5 distinct logic errors.
Identify the 5 logic errors in this flowchart and describe the required correction for each.
Show answer & marking schemeHide answer & marking scheme
Worked solution
1. **Initialization Error (Step 2)**: Initializing `MaxTemp` to 999 makes it impossible to find a realistic maximum temperature since actual temperatures are unlikely to exceed 999. It should be initialized to a low value like 0. 2. **Comparison Operator Error (Step 5)**: To find the maximum, the comparison must check if the new temperature is greater than the current maximum (`Temp > MaxTemp`), not smaller. 3. **Loop Reset Error**: Looping back to Step 2 resets `MaxTemp` to its initial value on every iteration, erasing the tracked maximum. It must loop back to Step 3 (`INPUT Temp`). 4. **Output Error (Step 8)**: The final output is `Temp`, which will always print the sentinel value `-1` because that is the value that triggered termination. It should print `MaxTemp`. 5. **Branch Logic Error**: Updating `MaxTemp` when `Temp < MaxTemp` is true is logically incorrect. The update must occur when `Temp > MaxTemp` is true.
Marking scheme
1 mark for each correctly identified error with its corresponding correction (up to 5 marks): - Error 1: Initializing MaxTemp to 999 | Correction: Initialize to 0 / low value. - Error 2: Checking Temp < MaxTemp | Correction: Change to Temp > MaxTemp. - Error 3: Looping back to Step 2 | Correction: Loop back to Step 3 / INPUT Temp. - Error 4: Outputting Temp | Correction: Output MaxTemp. - Error 5: Incorrect branch update logic (updating MaxTemp on Yes branch of Temp < MaxTemp) | Correction: Update MaxTemp on the Yes branch of Temp > MaxTemp.
One mark for each correct part, up to 5 marks: - 1 mark: Correct initial row with Code = "TX-58A2" and Count = 0. - 1 mark: Correct Pointer trace (1 to 7) and NextChar values ("T", "X", "-", "5", "8", "A", "2"). - 1 mark: Correct Count updates (1, 2, 3) in correct places. - 1 mark: Correct Array storage with "5" in NumArray[1], "8" in NumArray[2], and "2" in NumArray[3]. - 1 mark: Correct second loop Pointer trace (1, 2, 3) and OUTPUT column values ("5", "8", "2").
Question 4 · Algorithm debug / correction
4 marks
The purpose of this pseudocode algorithm is to find the lowest exam score (ranging from 0 to 100) and count how many students achieved this lowest score, from 200 scores stored in a one-dimensional (1D) array named Scores.
01 DECLARE Scores : ARRAY[1:200] OF INTEGER 02 DECLARE MinScore : CHAR 03 DECLARE Count : INTEGER 04 DECLARE Index : INTEGER 05 MinScore <- 0 06 Count <- 1 07 FOR Index <- 1 TO 200 08 IF Scores[Index] > MinScore 09 THEN 10 MinScore <- Scores[Index] 11 Count <- 0 12 ELSE 13 IF Scores[Index] = MinScore 14 THEN 15 Count <- Count + 1 16 ENDIF 17 ENDIF 18 NEXT Index
Identify the line numbers of four errors in the pseudocode and suggest a correction for each error.
Show answer & marking schemeHide answer & marking scheme
Worked solution
To correct this algorithm: 1. On line 02, the variable MinScore must be declared as an INTEGER because it holds test scores, not a character. 2. On line 05, initializing MinScore to 0 prevents finding any score lower than 0. It must be initialized to a value higher than any possible test score, such as 101, or the first element of the array (Scores[1]). 3. On line 08, the condition should check if the current score is less than the minimum score found so far (< instead of >). 4. On line 11, when a new lowest score is discovered, the frequency counter (Count) must be reset to 1, not 0, to include this newly found minimum score.
Marking scheme
Award 1 mark for each correct line number and its corresponding correction, up to a maximum of 4 marks: - Line 02: DECLARE MinScore : INTEGER - Line 05: MinScore <- 101 (or 100, or Scores[1], or any value >= 100) - Line 08: IF Scores[Index] < MinScore - Line 11: Count <- 1
Question 5 · Algorithm debug / correction
4 marks
The purpose of this pseudocode algorithm is to find the lowest exam score (ranging from 0 to 100) and count how many students achieved this lowest score, from 200 scores stored in a one-dimensional (1D) array named Scores.
01 DECLARE Scores : ARRAY[1:200] OF INTEGER 02 DECLARE MinScore : CHAR 03 DECLARE Count : INTEGER 04 DECLARE Index : INTEGER 05 MinScore <- 0 06 Count <- 1 07 FOR Index <- 1 TO 200 08 IF Scores[Index] > MinScore 09 THEN 10 MinScore <- Scores[Index] 11 Count <- 0 12 ELSE 13 IF Scores[Index] = MinScore 14 THEN 15 Count <- Count + 1 16 ENDIF 17 ENDIF 18 NEXT Index
Identify the line numbers of four errors in the pseudocode and suggest a correction for each error.
Show answer & marking schemeHide answer & marking scheme
Worked solution
To correct this algorithm: 1. On line 02, the variable MinScore must be declared as an INTEGER because it holds test scores, not a character. 2. On line 05, initializing MinScore to 0 prevents finding any score lower than 0. It must be initialized to a value higher than any possible test score, such as 101, or the first element of the array (Scores[1]). 3. On line 08, the condition should check if the current score is less than the minimum score found so far (< instead of >). 4. On line 11, when a new lowest score is discovered, the frequency counter (Count) must be reset to 1, not 0, to include this newly found minimum score.
Marking scheme
Award 1 mark for each correct line number and its corresponding correction, up to a maximum of 4 marks: - Line 02: DECLARE MinScore : INTEGER - Line 05: MinScore <- 101 (or 100, or Scores[1], or any value >= 100) - Line 08: IF Scores[Index] < MinScore - Line 11: Count <- 1
Question 6 · written
3 marks
A smart home heating system requires the user to input a target temperature. Write the pseudocode to allow a target temperature to be entered and to ensure that it is an integer between 15 and 28 inclusive. The target temperature must be re-input until it meets this requirement. Use an appropriate error message for inputs that do not meet the requirement. You do not need to declare any variables.
Show answer & marking schemeHide answer & marking scheme
Worked solution
REPEAT OUTPUT "Enter target temperature:" INPUT TargetTemp IF TargetTemp < 15 OR TargetTemp > 28 THEN OUTPUT "Invalid temperature. Please enter a value between 15 and 28." ENDIF UNTIL TargetTemp >= 15 AND TargetTemp <= 28
Marking scheme
1 mark: Correct use of a loop (e.g. REPEAT...UNTIL or WHILE) to control re-entry. 1 mark: Correct input inside the loop and condition checking both bounds (15 and 28 inclusive). 1 mark: Appropriate error message outputted inside the loop when target temperature is invalid.
Question 7 · written
3 marks
An online checkout system requires the user to input a coupon code. Write the pseudocode to allow a coupon code to be entered and to ensure that it contains exactly 6 characters. The code must be re-input until it meets this requirement. Use an appropriate error message for inputs that do not meet the requirement. You do not need to declare any variables.
Show answer & marking schemeHide answer & marking scheme
Worked solution
REPEAT OUTPUT "Enter 6-character coupon code:" INPUT CouponCode IF LENGTH(CouponCode) <> 6 THEN OUTPUT "Invalid coupon code length." ENDIF UNTIL LENGTH(CouponCode) = 6
Marking scheme
1 mark: Correct loop structure to repeat input until valid. 1 mark: Correct use of LENGTH function to check that the input has exactly 6 characters. 1 mark: Output of an error message when the input length is invalid.
Question 8 · short-answer
4 marks
A sports club uses a database table named MEMBER to store information about its members. The table contains these fields: - MemberID (unique identifier) - FirstName (text) - LastName (text) - Age (integer) - MembershipType (text) - FeesPaid (Boolean)
Complete the structured query language (SQL) statement to display only the first name, last name, and membership type of all members who are over 18 years old and have not paid their fees.
SELECT ........................................................................................................ FROM ................................................................ WHERE ..........................................................................................................;
Show answer & marking schemeHide answer & marking scheme
Worked solution
SELECT FirstName, LastName, MembershipType FROM MEMBER WHERE Age > 18 AND FeesPaid = FALSE;
Marking scheme
One mark per mark point: MP1: All correct fields in SELECT (FirstName, LastName, MembershipType in any order) MP2: Correct table name in FROM (MEMBER) MP3: Correct comparison for age in WHERE (Age > 18) MP4: Correct condition for unpaid fees in WHERE (FeesPaid = FALSE or FeesPaid = No or NOT FeesPaid) with correct logical AND operator
Question 9 · short-answer
4 marks
An online store uses a database table named PRODUCT to keep track of its inventory. The table contains these fields: - ProductCode (unique identifier) - Description (text) - Category (text) - UnitPrice (real) - StockLevel (integer) - Discontinued (Boolean)
Complete the structured query language (SQL) statement to list the product code, description, and stock level of all products in the 'Electronics' category with a stock level of less than 10.
SELECT ........................................................................................................ FROM ................................................................ WHERE ..........................................................................................................;
Show answer & marking schemeHide answer & marking scheme
Worked solution
SELECT ProductCode, Description, StockLevel FROM PRODUCT WHERE Category = 'Electronics' AND StockLevel < 10;
Marking scheme
One mark per mark point: MP1: All correct fields in SELECT (ProductCode, Description, StockLevel in any order) MP2: Correct table name in FROM (PRODUCT) MP3: Correct category check in WHERE (Category = 'Electronics' or Category = "Electronics") MP4: Correct stock level condition in WHERE (StockLevel < 10) connected with logical AND
Question 10 · Logic diagrams and expressions
3 marks
An automated ventilation system in a greenhouse is controlled by a logic circuit. The system has three inputs: T (temperature sensor): 1 if temperature is high, 0 if normal; H (humidity sensor): 1 if humidity is high, 0 if normal; C (manual override switch): 1 if override is on, 0 if off. The ventilator fan, V, is turned on (output 1) if: the temperature is high AND the manual override switch is off, OR the manual override switch is on AND the humidity is normal (not high). Write the logic expression for this system.
Show answer & marking schemeHide answer & marking scheme
Worked solution
1. First condition: 'temperature is high' (T) AND 'manual override switch is off' (NOT C). This is represented as: (T AND NOT C). 2. Second condition: 'manual override switch is on' (C) AND 'humidity is normal' (NOT H). This is represented as: (C AND NOT H). 3. These two parts are combined with OR to produce output V: V = (T AND NOT C) OR (C AND NOT H).
Marking scheme
One mark for each of the following: 1 mark for correct T AND NOT C part. 1 mark for correct C AND NOT H part. 1 mark for combining with OR and equating to V.
Question 11 · Logic diagrams and expressions
3 marks
Complete the truth table for the following logic expression: X = (NOT A AND B) OR (B AND NOT C). List the values of X for each binary input combination of A, B, and C in standard binary order from 000 to 111.
Show answer & marking schemeHide answer & marking scheme
Worked solution
Row 1 (000): (1 AND 0) OR (0 AND 1) = 0. Row 2 (001): (1 AND 0) OR (0 AND 0) = 0. Row 3 (010): (1 AND 1) OR (1 AND 1) = 1. Row 4 (011): (1 AND 1) OR (1 AND 0) = 1. Row 5 (100): (0 AND 0) OR (0 AND 1) = 0. Row 6 (101): (0 AND 0) OR (0 AND 0) = 0. Row 7 (110): (0 AND 1) OR (1 AND 1) = 1. Row 8 (111): (0 AND 1) OR (1 AND 0) = 0.
Marking scheme
Three marks for all 8 outputs correct. Two marks for 6 or 7 outputs correct. One mark for 4 or 5 outputs correct.
Question 12 · Logic diagrams and expressions
3 marks
A safety system in a manufacturing plant uses three sensors to monitor a robotic arm: P (pressure sensor): 1 if pressure is within limits, 0 if pressure is too high; G (safety guard switch): 1 if guard is closed, 0 if guard is open; E (emergency stop button): 1 if active (pressed), 0 if inactive. The safety alarm, A, must sound (output 1) if: the safety guard is open AND the pressure is too high, OR the emergency stop button is pressed. Write the logic expression for this safety system.
Show answer & marking schemeHide answer & marking scheme
Worked solution
1. 'Safety guard is open' is represented by NOT G (since G = 0 means open). 2. 'Pressure is too high' is represented by NOT P (since P = 0 means too high). 3. Combining these with AND gives: NOT G AND NOT P. 4. Combining this with 'emergency stop is pressed' (E) using OR gives the output A: A = (NOT G AND NOT P) OR E.
Marking scheme
One mark for each of the following: 1 mark for NOT G AND NOT P (or NOT P AND NOT G). 1 mark for OR E. 1 mark for correct complete expression including A =.
Question 13 · Scenario-based programming
15 marks
A charity needs a pet shelter database system to keep track of animals currently looking for homes.
The two-dimensional (2D) array PetStore[] is used to store, for each pet, the unique Pet ID, the species (Dog, Cat, Rabbit, or Bird), the age of the pet stored as a string, and a shelter location code, for example: PetStore[1,1] is "P452" PetStore[1,2] is "Dog" PetStore[1,3] is "3 years" PetStore[1,4] is "SH-B1"
The two-dimensional (2D) array Matches[] is used to store the results of a search to find pets of a specific species. The search uses the species, and if a match is found, its data is copied from the array PetStore[] to the array Matches[]. The search continues and if other pets of the same species are found, this data is also copied to the array Matches[]. The search ends when the end of the data is reached.
Write a program that meets the following requirements:
• The pet shelter database array needs to be initialised with the null string (""), allowing for up to 5000 records. The array Matches[] must be initialised before every search with the null string and must be able to hold up to 50 search results with the same species. • Create a menu to add a new pet to the database, to search for pets by species, or to stop, with validation of the input. • When the user enters a new pet, the following data is stored in the first available location of the relevant array: - unique Pet ID - species (Dog, Cat, Rabbit, or Bird) with validation - age as a string - shelter location code. • Allow input of data for another pet if required. • When searching for pets, if a match is found, transfer all the data for that pet into the array Matches[], and continue to search until all pets of that species have been found. • Output the results from the array Matches[]. • If no pets of that species are found, output a suitable message. • The system returns to the menu after completing the input or the output, until the user chooses to stop.
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to declare any arrays, variables or constants. You may assume that this has already been done.
All inputs and outputs must contain suitable messages.
Show answer & marking schemeHide answer & marking scheme
Worked solution
// Initialisation of the PetStore array FOR Index1 <- 1 TO 5000 FOR Index2 <- 1 TO 4 PetStore[Index1, Index2] <- "" NEXT Index2 NEXT Index1
// Display of menu choices REPEAT OUTPUT "Enter 1 to input data for a new pet, 2 to search for pets, or 3 to stop"
// Input menu choice with validation of input REPEAT INPUT Answer IF Answer <> 1 AND Answer <> 2 AND Answer <> 3 THEN OUTPUT "Invalid option. You must input 1, 2 or 3:" ENDIF UNTIL Answer = 1 OR Answer = 2 OR Answer = 3
// User chooses to input data for a new pet IF Answer = 1 THEN Store <- 1 // Finding the next available space in the array REPEAT IF PetStore[Store, 1] <> "" THEN Store <- Store + 1 ENDIF UNTIL PetStore[Store, 1] = "" OR Store > 5000
IF Store > 5000 THEN OUTPUT "Database is full." ELSE // Data entry and storage until user says no more needed REPEAT OUTPUT "Enter the unique Pet ID:" INPUT PetStore[Store, 1]
// Validation of species REPEAT OUTPUT "Enter the species (Dog, Cat, Rabbit, Bird):" INPUT ValidSpecies IF ValidSpecies <> "Dog" AND ValidSpecies <> "Cat" AND ValidSpecies <> "Rabbit" AND ValidSpecies <> "Bird" THEN OUTPUT "Invalid species entered. Please try again." ENDIF UNTIL ValidSpecies = "Dog" OR ValidSpecies = "Cat" OR ValidSpecies = "Rabbit" OR ValidSpecies = "Bird"
PetStore[Store, 2] <- ValidSpecies
OUTPUT "Enter the age of the pet:" INPUT PetStore[Store, 3]
OUTPUT "Enter the shelter location code:" INPUT PetStore[Store, 4]
Store <- Store + 1
OUTPUT "Do you want to add another pet (Y or N)?" INPUT Another UNTIL (Another = 'N' OR Another = 'n') OR Store > 5000 ENDIF ENDIF
// User chooses to search for a species IF Answer = 2 THEN // Initialisation of Matches array FOR Index1 <- 1 TO 50 FOR Index2 <- 1 TO 4 Matches[Index1, Index2] <- "" NEXT Index2 NEXT Index1
OUTPUT "Enter the species of the pet you want to search for:" INPUT SearchSpecies
SearchIndex <- 1 MatchCount <- 1
// Searching for the species REPEAT IF PetStore[SearchIndex, 2] = SearchSpecies THEN IF MatchCount <= 50 THEN FOR Index1 <- 1 TO 4 Matches[MatchCount, Index1] <- PetStore[SearchIndex, Index1] NEXT Index1 MatchCount <- MatchCount + 1 ENDIF ENDIF SearchIndex <- SearchIndex + 1 UNTIL PetStore[SearchIndex, 1] = "" OR SearchIndex > 5000
// Outputting results or not found message IF Matches[1, 1] <> "" THEN OUTPUT "Matching records found:" FOR Index1 <- 1 TO MatchCount - 1 OUTPUT "ID: ", Matches[Index1, 1], " | Species: ", Matches[Index1, 2], " | Age: ", Matches[Index1, 3], " | Location: ", Matches[Index1, 4] NEXT Index1 ELSE OUTPUT "No pets of that species found in the database." ENDIF ENDIF UNTIL Answer = 3
Marking scheme
AO2: Apply knowledge and understanding (maximum 9 marks) • 1–3 Marks: Minimal structure. Basic variable declarations or partial array initialisation. At least one basic technique (e.g., input/output) is present. • 4–6 Marks: Good use of multiple techniques. Proper nested loops for initialising PetStore[5000, 4] and Matches[50, 4]. Implements a validated menu and stores data appropriately. Search logic attempts to copy elements on match. • 7–9 Marks: Highly accurate logic. Full range of programming techniques used appropriately. PetStore and Matches correctly initialised. Input and storage handled seamlessly with first-available slot calculation. Search copies elements to Matches correctly and displays appropriate output and custom empty messages.
AO3: Provide solutions to problems (maximum 6 marks) • 1–2 Marks: Partially working solution, lacking sufficient internal comments, or uses unhelpful identifiers. • 3–4 Marks: Logical program flow with minor errors. Consistent variable naming. Comments explain some complex code blocks. • 5–6 Marks: Fully commented, accurate program in a logical order, fulfilling all criteria perfectly. Fully validates species matching the four specified values. Handles limits gracefully (e.g., prevents array out-of-bounds).
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.