An original Thinka practice paper modelled on the structure and difficulty of the Nov 2025 (V3) Cambridge IGCSE Computer Science (0478) paper. Not affiliated with or reproduced from Cambridge.
卷一 Computer Systems
Answer all questions. Calculators must not be used in this paper. Total marks: 75.
27 题目 · 78 分
题目 1 · Short Answer
1.5 分
Many digital systems represent colors using hexadecimal codes rather than binary. State and explain one reason why computer scientists prefer using hexadecimal notation over binary notation.
查看答案详解收起答案详解
解题
Hexadecimal notation is more compact than binary (representing 4 bits as a single character), which makes it significantly easier for human programmers to read, write, remember, and debug. This reduces the likelihood of transcription errors without changing how the computer itself processes the data.
评分标准
1 mark for stating that it is easier for humans to read, write, remember, or is less prone to errors. 0.5 mark for explaining that it is a shorter or more compact representation (each hex digit represents exactly 4 binary bits).
题目 2 · Short Answer
1.5 分
Data transmission can occur via serial or parallel methods. State one advantage and one disadvantage of using serial data transmission instead of parallel data transmission.
查看答案详解收起答案详解
解题
Serial data transmission sends data one bit at a time over a single wire. This significantly reduces the cost of cabling and eliminates the problem of data skewing/crosstalk over long distances. However, because it only transmits one bit at a time, it has a slower rate of data transfer compared to parallel transmission over short distances.
评分标准
1 mark for a valid advantage (e.g., lower cabling cost, less crosstalk, or no data skewing over long distances). 0.5 mark for a valid disadvantage (e.g., slower data transfer rate over short distances).
题目 3 · Short Answer
1.5 分
An office worker receives an email that looks like it is from their email provider, warning them that their mailbox is full and providing a link to upgrade their storage. Identify this type of security threat and explain how the worker can determine if the email is fraudulent.
查看答案详解收起答案详解
解题
This social engineering technique is known as phishing. It uses deceptive emails to trick users into revealing sensitive information. The worker can identify it as fake by looking for spelling and grammatical errors, generic greetings (like 'Dear User' instead of their name), or hovering over the link to verify that the target URL does not match the official company domain.
评分标准
0.5 mark for identifying the threat as phishing. 1 mark for explaining a valid identification method (e.g., checking for spelling mistakes, checking the sender's actual email domain, or verifying the destination URL by hovering over the link).
题目 4 · Short Answer
1.5 分
The Central Processing Unit (CPU) contains several dedicated registers. Describe the purpose of the Memory Address Register (MAR) in the Von Neumann architecture.
查看答案详解收起答案详解
解题
The Memory Address Register (MAR) is a CPU register that holds the physical address of the current memory location in RAM that is being accessed for a read or write operation. It is directly connected to the address bus to specify the target memory location.
评分标准
1 mark for explaining that it holds the address of the memory location currently being read from or written to. 0.5 mark for stating that it sends this address to memory via the address bus.
题目 5 · Short Answer
1.5 分
In digital audio recording, analog sound waves are sampled at regular intervals. Explain what is meant by the term 'sample resolution'.
查看答案详解收起答案详解
解题
Sample resolution (also known as bit depth) refers to the number of bits allocated to represent the amplitude of each audio sample. A higher sample resolution allows for a wider dynamic range and a more accurate representation of the original analog sound wave, but increases file size.
评分标准
1 mark for defining sample resolution as the number of bits used to represent/store each audio sample. 0.5 mark for explaining its effect (e.g., higher resolution leads to more accurate sound reproduction or a larger file size).
题目 6 · Short Answer
1.5 分
A design company is choosing secondary storage for their portable field laptops. Explain why they would select a Solid State Drive (SSD) instead of a magnetic Hard Disk Drive (HDD).
查看答案详解收起答案详解
解题
Solid State Drives (SSDs) use flash memory and have no moving mechanical parts, which makes them highly shock-resistant and durable for portable field laptops. Additionally, SSDs provide significantly faster read/write speeds, allowing files to load much faster.
评分标准
1 mark for explaining the physical durability/robustness due to no moving parts (essential for portable laptops). 0.5 mark for mentioning another benefit such as faster read/write speeds, lighter weight, or lower power consumption.
题目 7 · Short Answer
1.5 分
Artificial Intelligence can be applied in various industries through the use of expert systems. State the three main components that make up a typical expert system.
查看答案详解收起答案详解
解题
An expert system mimics the decision-making ability of a human expert. It consists of three primary components: the User Interface (to interact with the user), the Inference Engine (the reasoning system that applies rules to the data), and the Knowledge Base (the repository of facts and rules).
评分标准
0.5 mark for each correct component identified: User interface, Inference engine, and Knowledge base (up to a maximum of 1.5 marks).
题目 8 · Short Answer
1.5 分
Logic gates are used to build computer circuits. Describe the rule that determines the output of a two-input XOR (Exclusive OR) logic gate.
查看答案详解收起答案详解
解题
A two-input XOR gate outputs a 1 (high) if and only if one of the inputs is 1 and the other is 0 (i.e., the inputs are different). If both inputs are 0 or both inputs are 1 (the inputs are the same), the output is 0 (low).
评分标准
1 mark for stating that the output is high/1 when the inputs are different (one is 1 and the other is 0). 0.5 mark for stating that the output is low/0 when both inputs are identical (both 0 or both 1).
题目 9 · Short Answer
1.5 分
A music producer has composed a new track. They are deciding whether to save the draft of the composition as a MIDI file or as an MP3 file.
Describe two differences between a MIDI file and an MP3 file.
查看答案详解收起答案详解
解题
1. MIDI files contain performance instructions (such as pitch, volume, and tempo) rather than actual audio, whereas MP3 files contain actual compressed audio recordings. 2. MIDI files are significantly smaller in file size compared to MP3 files because they do not store digital audio waveforms.
评分标准
One mark per correct difference (max 1.5): - MIDI stores performance data/instructions whereas MP3 stores actual recording of sound [0.75] - MIDI files are much smaller in size than MP3 files [0.75] - MIDI requires a synthesizer/instrument to generate sound on playback whereas MP3 can be played directly on any standard audio player [0.75]
题目 10 · Short Answer
1.5 分
Universal Serial Bus (USB) is a very common interface used to connect peripheral devices to a computer.
Identify two benefits of using a USB connection.
查看答案详解收起答案详解
解题
1. It is a plug-and-play interface, meaning devices are automatically detected and configured without needing a computer restart. 2. It can provide power to the connected device, removing the need for a separate external power supply.
评分标准
One mark per correct benefit (max 1.5): - It is plug-and-play / hot-swappable [0.75] - It provides electrical power to run the device [0.75] - It is a universal standard / widely compatible [0.75] - It has a high data transmission rate [0.75]
题目 11 · Short Answer
1.5 分
During the fetch-decode-execute cycle, several registers within the central processing unit (CPU) are used.
Describe the role of the Memory Address Register (MAR) and the Memory Data Register (MDR) during the fetch stage.
查看答案详解收起答案详解
解题
1. MAR: Stores the memory address of the next instruction or data byte that needs to be fetched from memory. 2. MDR: Temporarily stores the instruction or data that has just been read from memory (or is about to be written to memory).
评分标准
One mark for MAR role and one mark for MDR role (max 1.5): - MAR: Holds the memory address of the current instruction/data to be fetched from RAM [0.75] - MDR: Holds the actual data/instruction that has been fetched from RAM [0.75]
题目 12 · Short Answer
1.5 分
A small business wants to protect its local network from external threats. They decide to install a firewall.
State the role of a firewall and describe one method it uses to secure the network.
查看答案详解收起答案详解
解题
Role: To monitor and control incoming and outgoing network traffic based on predetermined security rules. Method: Packet filtering, which inspects packets of data to check if they meet set criteria and blocks those that do not.
评分标准
One mark for stating the role, one mark for describing a method (max 1.5): - Role: Monitors traffic / acts as a filter/barrier between the internal network and the internet [0.75] - Method: Packet filtering (examines packets and blocks those failing criteria) // IP address blocking (blocks traffic from known bad IPs) [0.75]
题目 13 · Structured
4 分
A digital weather station records the lowest overnight temperature. It stores the temperature as an 8-bit signed integer using two's complement representation.
(a) Convert the denary value -27 into an 8-bit two's complement binary integer. Show your working. [2]
(b) Convert your binary answer from part (a) into hexadecimal. Show your working. [2]
查看答案详解收起答案详解
解题
(a) To represent -27 in 8-bit two's complement: 1. Find the binary representation of +27: 128 64 32 16 8 4 2 1 0 0 0 1 1 0 1 1 => 00011011 2. Invert all the bits (one's complement): 11100100 3. Add 1 to the result: 11100100 + 1 = 11100101
(b) To convert 11100101 to hexadecimal: 1. Split the 8-bit binary into two 4-bit nibbles: 1110 and 0101 2. Convert each nibble to denary, then to hex: 1110 = 14 in denary = E in hex 0101 = 5 in denary = 5 in hex 3. Combine the hex digits: E5
评分标准
(a) Max 2 marks: - 1 mark for correct working (e.g. correct binary for +27 or one's complement shown) - 1 mark for correct final 8-bit binary: 11100101
(b) Max 2 marks: - 1 mark for converting nibbles correctly (e.g. 1110 to E or 0101 to 5) - 1 mark for correct final hexadecimal representation: E5
题目 14 · Structured
4 分
A control system in a smart factory transmits sensor data to a central monitoring unit using parallel half-duplex data transmission.
(a) Describe how data is transmitted using parallel half-duplex transmission. [3]
(b) State one reason why serial transmission is preferred over parallel transmission for long-distance communication. [1]
查看答案详解收起答案详解
解题
(a) In parallel transmission, multiple bits (usually a byte) are sent at the exact same time using multiple physical wires or communication channels. Half-duplex means that the transmission path is shared so that data can flow in both directions (bi-directionally), but only one direction at any given instant.
(b) Serial transmission sends data bit by bit over a single wire. This eliminates the risk of bits arriving out of sync (skewing), which is a common issue with parallel lines over long distances. It also greatly reduces cabling costs.
评分标准
(a) Max 3 marks: - 1 mark for explaining that multiple bits are sent at the same time / simultaneously. - 1 mark for explaining that multiple physical lines/channels/wires are used. - 1 mark for explaining that transmission can go in both directions, but not at the same time.
(b) Max 1 mark: - 1 mark for stating that serial prevents data skewing / bits arriving out of synchronization. - Alternative: 1 mark for stating that serial is cheaper / requires fewer wires to install over long distances.
题目 15 · Structured
4 分
An embedded microprocessor in a smart home device uses the Von Neumann architecture. During the fetch stage of the fetch-decode-execute (FDE) cycle, several registers are used.
Describe the role of the following registers during the fetch stage:
(i) Program Counter (PC) [2]
(ii) Memory Address Register (MAR) [2]
查看答案详解收起答案详解
解题
(i) The Program Counter (PC) keeps track of the memory address of the next instruction that needs to be executed. Once the current cycle's address is sent to the MAR, the PC is automatically incremented by 1 so that it points to the next sequential instruction in memory.
(ii) The Memory Address Register (MAR) serves as a holding register for the memory address that is currently being accessed for a read or write operation. During the fetch phase, it takes the address copied from the PC and places it on the address bus to locate the instruction in RAM.
评分标准
(i) Program Counter (PC) - Max 2 marks: - 1 mark: Holds the address of the next instruction to be fetched. - 1 mark: Increments (by 1) to prepare for the subsequent cycle.
(ii) Memory Address Register (MAR) - Max 2 marks: - 1 mark: Receives/copies the address of the instruction from the PC. - 1 mark: Temporarily holds this address while the memory is being accessed (via the address bus).
题目 16 · Structured
4 分
An e-commerce website is targeted by a Denial of Service (DoS) attack.
(a) Explain how a Denial of Service (DoS) attack is carried out. [2]
(b) Describe two effects a DoS attack can have on the online business. [2]
查看答案详解收起答案详解
解题
(a) A Denial of Service (DoS) attack involves sending a massive flood of traffic or resource requests to a target system or web server. The volume of traffic is so immense that it exhausts the server's network bandwidth, memory, or processing power, rendering it unable to handle legitimate incoming connections.
(b) Two direct consequences include: 1. Legitimate customers are locked out or face severe delays, leading to immediately lost sales transactions. 2. Long-term reputational damage, as users lose confidence in the reliability and safety of the e-commerce service.
评分标准
(a) Max 2 marks: - 1 mark: Flooding the server/network with a very high volume of requests/traffic. - 1 mark: Overwhelming the system resources/bandwidth so it cannot process legitimate requests.
(b) Max 2 marks (any two from): - Legitimate users/customers cannot access the website/services [1] - The server slows down significantly or crashes [1] - Loss of revenue/sales during the downtime [1] - Damage to the brand's reputation / loss of customer trust [1]
题目 17 · Structured
4 分
A podcaster records an episode. The sound recording is sampled and converted into digital format.
(a) Describe how analogue sound is converted into a digital format. [2]
(b) Explain how the sample rate and sample resolution affect the overall file size of the recording. [2]
查看答案详解收起答案详解
解题
(a) To convert analogue sound to digital, a microphone captures the continuous sound wave. An Analogue-to-Digital Converter (ADC) samples (measures) the amplitude of the wave at fixed, frequent intervals of time. These numeric measurements are then rounded to the nearest available digital value and represented as binary numbers.
(b) The sample rate determines how many samples are taken per second, and the sample resolution (bit depth) determines the number of bits used to store each sample. Increasing either parameter means that a larger number of bits must be recorded for every second of audio, directly causing the file size to grow.
评分标准
(a) Max 2 marks: - 1 mark: The amplitude of the analogue sound wave is measured/sampled at regular time intervals. - 1 mark: These measurements are converted to/stored as binary values.
(b) Max 2 marks: - 1 mark: Higher sample rate/resolution means more data/bits are captured and saved per second. - 1 mark: This leads to an increase in the overall storage size of the audio file (or vice versa).
题目 18 · Structured
4 分
An operating system manages the execution of multiple tasks. It uses interrupts to handle urgent events.
(a) Define what is meant by an interrupt. [2]
(b) Describe how the CPU handles an interrupt when it is detected during the fetch-decode-execute cycle. [2]
查看答案详解收起答案详解
解题
(a) An interrupt is a specialized signal generated by hardware (such as a keyboard press or a printer warning) or software (such as an error like division by zero). It is sent directly to the CPU to request that it halt what it is doing and prioritize the incoming request.
(b) At the end of each fetch-decode-execute cycle, the CPU checks if any interrupts are active. If an interrupt is present, the CPU halts its current operations, saves the contents of its registers (its state) onto a stack in memory, calls the appropriate Interrupt Service Routine (ISR) program, executes it, and once complete, restores the saved register contents to continue where it left off.
评分标准
(a) Max 2 marks: - 1 mark: A signal sent to the CPU from a hardware device or software. - 1 mark: Requests immediate attention / pauses execution of the current program.
(b) Max 2 marks (any two from): - Pauses/suspends execution of the current task [1] - Saves the current state / register values (to memory/stack) [1] - Executes the specific Interrupt Service Routine (ISR) to handle the interrupt [1] - Restores the saved state and resumes the previous program [1]
题目 19 · Structured
4 分
A medical clinic uses an expert system to assist doctors in diagnosing rare skin conditions.
(a) Describe the three main components of an expert system. [3]
(b) State one limitation of using an expert system in medical diagnosis. [1]
查看答案详解收起答案详解
解题
(a) An expert system consists of: 1. User Interface: The gateway allowing a non-expert user (or doctor) to interact with the system by inputting queries/symptoms and viewing the produced outputs. 2. Knowledge Base: A massive repository of domain-specific facts, logic, and rules gathered from human industry experts. 3. Inference Engine: The reasoning processor that applies logical reasoning methods to the user input against the rules in the knowledge base to derive solutions.
(b) A primary limitation is that it lacks human intuition and common sense. If a patient presents a completely novel combination of symptoms not stored in the rules, the system might fail completely or provide a dangerously incorrect diagnosis.
评分标准
(a) Max 3 marks: - 1 mark: User Interface - accepts user input (symptoms) and displays results/diagnoses. - 1 mark: Knowledge Base - stores the factual knowledge and IF-THEN rules established by human experts. - 1 mark: Inference Engine - the program that applies logical rules to search the knowledge base and draw conclusions.
(b) Max 1 mark: - 1 mark: Lacks human empathy/intuition/judgment. - Alternative: 1 mark: Highly dependent on the accuracy/completeness of the knowledge base (garbage in, garbage out).
题目 20 · Structured
4 分
A student enters a URL into a web browser to access an educational website.
(a) Describe the role of a Domain Name Server (DNS) in this process. [2]
(b) Explain how web browsers use cookies to improve the user's experience on the website. [2]
查看答案详解收起答案详解
解题
(a) A Domain Name Server (DNS) behaves like an address book for the internet. When a user types a human-readable domain name (like www.example.com), the browser queries a DNS. The DNS searches its records to match the domain name to its corresponding IP address (like 192.0.2.1) and returns it to the browser, allowing it to connect to the host server.
(b) Web browsers store cookies, which are sent by the website to the user's computer. They store useful state data, such as keeping a user logged in, remembering their interface preferences (e.g., dark mode or language), or tracking an active shopping cart, avoiding the frustration of repetitive inputs.
评分标准
(a) Max 2 marks: - 1 mark: Translates/resolves a user-friendly domain name (URL) into a numeric IP address. - 1 mark: Looks up the matching entry in a database and returns it to the web browser.
(b) Max 2 marks (any two from): - Stores user preferences (e.g. language/theme) to keep the site customized [1] - Remembers login session details so the user does not have to log in repeatedly [1] - Tracks past browsing history or cart content to offer personalized recommendations [1]
题目 21 · Structured/Explain
4 分
A smart monitoring system transmits sensor data to a cloud server. To ensure the transmission is accurate, a checksum is used.
Describe how a checksum is calculated and used to detect transmission errors.
查看答案详解收起答案详解
解题
1. Before transmission, the sender calculates a checksum value using a specific algorithm applied to the block of data. 2. The calculated checksum value is appended to the data block and transmitted along with it. 3. Upon receiving the transmission, the receiver applies the exact same algorithm to the received data block to calculate its own checksum value. 4. The receiver compares its calculated checksum with the transmitted checksum. If they match, the data is assumed error-free; if they do not match, an error is detected, and a retransmission request is sent.
评分标准
Award 1 mark per point up to a maximum of 4 marks: - One mark for stating the sender calculates the checksum before transmission using a specific algorithm/formula. - One mark for stating the checksum is sent/appended with the data block. - One mark for stating the receiver recalculates the checksum using the same algorithm on the received data. - One mark for stating that both values are compared, and if they differ, an error has occurred / retransmission is requested.
题目 22 · Structured/Explain
4 分
A computer system is executing a program when a hardware device sends an interrupt signal to the CPU.
Describe the steps taken by the CPU to handle this interrupt.
查看答案详解收起答案详解
解题
1. The CPU checks for interrupt signals at the end of each fetch-decode-execute cycle. 2. If an interrupt is detected, the CPU suspends the execution of the current program. 3. The current status of the CPU registers (including the Program Counter) is saved onto a stack. 4. The CPU identifies the source of the interrupt and runs the appropriate Interrupt Service Routine (ISR). 5. Once the ISR is completed, the saved registers are restored from the stack, and the CPU resumes executing the original program from where it was suspended.
评分标准
Award 1 mark per point up to a maximum of 4 marks: - One mark for stating the CPU checks for interrupts at the end of an instruction/FDE cycle. - One mark for stating the current task is suspended and register values (e.g. Program Counter/Accumulator) are saved on a stack. - One mark for running the Interrupt Service Routine (ISR). - One mark for restoring the registers and resuming the original program.
题目 23 · Calculations / Tables
4 分
A wildlife filmmaker records a mono audio clip of a bird song. The audio recording has the following characteristics: - sample rate: 40,000 Hz - sample resolution: 16 bits - duration: 50 seconds.
Calculate the estimated file size of the audio clip in Megabytes (MB). Show all your working. Assume 1 MB = 1,000,000 bytes.
查看答案详解收起答案详解
解题
1. Convert the sample resolution from bits to bytes: \(16\text{ bits} = 2\text{ bytes}\).
2. Calculate the total size in bytes: \(40,000\text{ samples/sec} \times 2\text{ bytes/sample} \times 50\text{ seconds} = 4,000,000\text{ bytes}\).
3. Convert the total bytes to Megabytes (MB): \(4,000,000\text{ bytes} / 1,000,000\text{ bytes/MB} = 4\text{ MB}\).
评分标准
- 1 mark for converting resolution to bytes (16 bits = 2 bytes) or correctly multiplying with 16 and dividing by 8 later. - 1 mark for correct formula expression: 40,000 * 2 * 50 (or 40,000 * 16 * 50 / 8). - 1 mark for showing correct intermediate value (e.g., 4,000,000 bytes or 32,000,000 bits). - 1 mark for correct final answer with units: 4 MB (accept 4).
题目 24 · Calculations / Tables
4 分
An 8-bit register stores a negative denary number using two's complement representation.
(i) Show that the denary value of the 8-bit binary integer 11001101 is -51. Show all your working. [2]
(ii) Write the two's complement 8-bit binary integer that represents the denary value -88. Show all your working. [2]
(i) - 1 mark for identifying place values or showing the addition: -128 + 64 + 8 + 4 + 1. - 1 mark for correctly reaching the final value of -51.
(ii) - 1 mark for correct positive representation (01011000) and showing conversion step (inverting bits: 10100111). - 1 mark for correct final binary representation: 10101000.
题目 25 · Calculations / Tables
4 分
A system monitors a greenhouse and generates an alarm signal (A = 1) based on three inputs: - Temperature high (T = 1) - Humidity low (H = 1) - Ventilation open (V = 1)
The alarm is activated (A = 1) if: - Temperature is high AND humidity is NOT low - OR - Humidity is low AND ventilation is NOT open
(i) Write the logic expression for this system. [2]
(ii) Complete the truth table below by determining the output values of A for each state. [2]
(i) Translating the conditions: - 'Temperature is high AND humidity is NOT low' -> \(T \text{ AND NOT } H\) - 'Humidity is low AND ventilation is NOT open' -> \(H \text{ AND NOT } V\) Combining them with OR gives: \(A = (T \text{ AND NOT } H) \text{ OR } (H \text{ AND NOT } V)\).
(ii) Let's evaluate each row: - Row 1: 0 0 0 -> (0 AND 1) OR (0 AND 1) = 0 - Row 2: 0 0 1 -> (0 AND 1) OR (0 AND 0) = 0 - Row 3: 0 1 0 -> (0 AND 0) OR (1 AND 1) = 1 - Row 4: 0 1 1 -> (0 AND 0) OR (1 AND 0) = 0 - Row 5: 1 0 0 -> (1 AND 1) OR (0 AND 1) = 1 - Row 6: 1 0 1 -> (1 AND 1) OR (0 AND 0) = 1 - Row 7: 1 1 0 -> (1 AND 0) OR (1 AND 1) = 1 - Row 8: 1 1 1 -> (1 AND 0) OR (1 AND 0) = 0
评分标准
(i) - 1 mark for (T AND NOT H) - 1 mark for (H AND NOT V) joined by OR
(ii) - 2 marks for all 8 outputs correct (0, 0, 1, 0, 1, 1, 1, 0) - 1 mark for 5 to 7 outputs correct
题目 26 · Calculations / Tables
4 分
A system transmits a block of data consisting of four 7-bit bytes. An even parity bit is added as the MSB (most significant bit, leftmost bit) of each byte. A fifth byte, the parity byte, is transmitted at the end of the block to act as a longitudinal redundancy check (using even parity).
The table below shows the block of data received, but one of the bits has been corrupted during transmission.
(i) Identify the byte number and the bit number of the corrupted bit. [2]
(ii) Explain how you located the corrupted bit. [2]
查看答案详解收起答案详解
解题
(i) Byte 2, Bit 7.
(ii) 1. Count the number of 1s in each row (Byte 1 to Parity Byte): - Byte 1: 4 (even) - Byte 2: 5 (odd) -> Error! - Byte 3: 4 (even) - Byte 4: 4 (even) - Parity Byte: 4 (even) Therefore, Byte 2 contains the error.
2. Count the number of 1s in each column (Bit 7 to Bit 0): - Bit 7: 3 (odd) -> Error! - Bit 6: 2 (even) - Bit 5: 4 (even) - Bit 4: 4 (even) - Bit 3: 2 (even) - Bit 2: 2 (even) - Bit 1: 4 (even) - Bit 0: 0 (even) Therefore, Bit 7 contains the error.
3. The intersection of Byte 2 and Bit 7 determines the single corrupted bit.
评分标准
(i) - 1 mark for identifying Byte 2. - 1 mark for identifying Bit 7.
(ii) - 1 mark for explaining that Byte 2 has an odd number of 1s (or fails the even parity check). - 1 mark for explaining that Bit 7 has an odd number of 1s (or fails the even parity check).
题目 27 · Calculations / Tables
4 分
An image file has a resolution of 800 x 600 pixels and a colour depth of 24 bits per pixel.
(i) Calculate the uncompressed file size of this image in Kilobytes (KB). Show all your working. Assume 1 KB = 1000 bytes. [2]
(ii) If the colour depth is reduced to 8 bits, calculate the new file size in Kilobytes (KB). Show all your working. [2]
查看答案详解收起答案详解
解题
(i) - Total number of pixels = \(800 \times 600 = 480,000\text{ pixels}\). - Colour depth = \(24\text{ bits} = 3\text{ bytes per pixel}\). - Size in bytes = \(480,000 \times 3 = 1,440,000\text{ bytes}\). - Size in KB = \(1,440,000 / 1000 = 1440\text{ KB}\).
(ii) - New colour depth = \(8\text{ bits} = 1\text{ byte per pixel}\). - Size in bytes = \(480,000 \times 1 = 480,000\text{ bytes}\). - Size in KB = \(480,000 / 1000 = 480\text{ KB}\). - Alternatively: New size = \(1440\text{ KB} \times (8 / 24) = 480\text{ KB}\).
评分标准
(i) - 1 mark for calculating total pixels (480,000) or converting 24 bits to 3 bytes. - 1 mark for correct final answer of 1440 KB (with units).
(ii) - 1 mark for calculating total size using 8 bits per pixel (e.g., 480,000 bytes) or showing proportional reduction (1440 / 3). - 1 mark for correct final answer of 480 KB (with units).
Answer all questions. Calculators must not be used in this paper. Total marks: 75.
11 题目 · 55 分
题目 1 · dry_run_trace_table
3 分
An algorithm processes 5 consecutive temperature readings in a smart greenhouse to count how many times the temperature fluctuated by more than 3 degrees between consecutive readings.
The pseudocode for the algorithm is shown below:
01 Fluctuations <- 0 02 INPUT PrevTemp 03 FOR Count <- 1 TO 4 04 INPUT NextTemp 05 Diff <- NextTemp - PrevTemp 06 IF Diff < 0 07 THEN 08 Diff <- Diff * -1 09 ENDIF 10 IF Diff > 3 11 THEN 12 Fluctuations <- Fluctuations + 1 13 ENDIF 14 PrevTemp <- NextTemp 15 NEXT Count 16 OUTPUT Fluctuations
Complete the trace table for this algorithm using the following input data: 18, 22, 15, 17, 21
Let's perform the dry run step-by-step: - Fluctuations is initialized to 0. - INPUT PrevTemp receives the first temperature reading: 18. - Count = 1: - INPUT NextTemp receives 22. - Diff = 22 - 18 = 4. - Since Diff > 3, Fluctuations increases to 1. - PrevTemp becomes 22. - Count = 2: - INPUT NextTemp receives 15. - Diff = 15 - 22 = -7. - Since Diff < 0, Diff is multiplied by -1, becoming 7. - Since Diff > 3 (7 > 3), Fluctuations increases to 2. - PrevTemp becomes 15. - Count = 3: - INPUT NextTemp receives 17. - Diff = 17 - 15 = 2. - Since Diff < 3, Fluctuations remains 2. - PrevTemp becomes 17. - Count = 4: - INPUT NextTemp receives 21. - Diff = 21 - 17 = 4. - Since Diff > 3, Fluctuations increases to 3. - PrevTemp becomes 21. - After loop termination, OUTPUT Fluctuations displays 3.
评分标准
- 1 mark: Correct values in Count and NextTemp columns. - 1 mark: Correct calculated values in Diff (showing -7 then 7) and updated PrevTemp values. - 1 mark: Correct values in Fluctuations column and final output of 3.
题目 2 · matching_diagram
3 分
Three descriptions of validation checks and five validation checks are given.
Draw one line from each description to the correct validation check. Not all validation checks will be used.
Descriptions: 1. Checks that the data entered contains only digits or only letters. 2. Checks that a required input field is not left blank. 3. Checks that a number is between 1 and 100 inclusive.
Validation Checks: - Presence check - Range check - Length check - Type check - Format check
查看答案详解收起答案详解
解题
Matching analysis: - Checking if data consists only of a specific data type (digits/letters) is a Type check. - Checking if a required input is not empty is a Presence check. - Checking if a value lies within a set minimum and maximum is a Range check.
评分标准
1 mark for each correct line matched, up to a maximum of 3 marks.
题目 3 · dry_run_trace_table
4 分
A 1D array named Marks contains the following five test scores: Marks = [45, 80, 32, 90, 70]
An algorithm is written to find the number of scores below 50, and also calculate the average of the scores that are 50 or above.
The pseudocode for the algorithm is:
01 BelowFiftyCount <- 0 02 AboveFiftySum <- 0 03 AboveFiftyCount <- 0 04 FOR Index <- 1 TO 5 05 IF Marks[Index] < 50 06 THEN 07 BelowFiftyCount <- BelowFiftyCount + 1 08 ELSE 09 AboveFiftySum <- AboveFiftySum + Marks[Index] 10 AboveFiftyCount <- AboveFiftyCount + 1 11 ENDIF 12 NEXT Index 13 IF AboveFiftyCount > 0 14 THEN 15 AverageAboveFifty <- AboveFiftySum / AboveFiftyCount 16 ELSE 17 AverageAboveFifty <- 0 18 ENDIF 19 OUTPUT BelowFiftyCount 20 OUTPUT AverageAboveFifty
- 1 mark: Correct initial row values and correct Index progression (1 to 5) with corresponding Marks[Index] values. - 1 mark: Correct BelowFiftyCount progression (0, 1, 2). - 1 mark: Correct AboveFiftySum (80, 170, 240) and AboveFiftyCount (1, 2, 3) progressions. - 1 mark: Correct calculated AverageAboveFifty as 80 and correct final OUTPUT values (2, 80).
题目 4 · Pseudocode writing
5 分
A smart greenhouse monitoring system records temperature values. Write an algorithm in pseudocode to: 1. Input exactly 10 temperature values. 2. Count how many temperatures are below 15 degrees Celsius (too cold). 3. Count how many temperatures are above 30 degrees Celsius (too hot). 4. Calculate the average temperature of the 10 values. 5. Output the two counts and the calculated average temperature with appropriate messages.
查看答案详解收起答案详解
解题
TooCold <- 0 TooHot <- 0 Total <- 0 FOR Count <- 1 TO 10 OUTPUT "Enter temperature:" INPUT Temp IF Temp < 15 THEN TooCold <- TooCold + 1 ELSE IF Temp > 30 THEN TooHot <- TooHot + 1 ENDIF ENDIF Total <- Total + Temp NEXT Count Average <- Total / 10 OUTPUT "Too cold count: ", TooCold OUTPUT "Too hot count: ", TooHot OUTPUT "Average temperature: ", Average
评分标准
1 mark: Initialising variables (TooCold, TooHot, Total set to 0) 1 mark: A count-controlled loop running exactly 10 times 1 mark: Correct conditional checks for (< 15) and (> 30) and incrementing corresponding counters 1 mark: Accumulating the total and calculating the average outside the loop (Total / 10) 1 mark: Outputting the counts and average with appropriate messages
题目 5 · Pseudocode writing
5 分
A school needs to record the names of students who have passed a test. The pass mark is 50. Write an algorithm in pseudocode to: 1. Open a sequential text file called "passed.txt" for writing. 2. Repeatedly input a student's name and their test mark. 3. Write the student's name to the file if their mark is 50 or above. 4. Terminate the input when a student name of "END" is entered. 5. Correctly close the file at the end.
查看答案详解收起答案详解
解题
OPENFILE "passed.txt" FOR WRITE OUTPUT "Enter student name:" INPUT Name WHILE Name <> "END" DO OUTPUT "Enter student mark:" INPUT Mark IF Mark >= 50 THEN WRITEFILE "passed.txt", Name ENDIF OUTPUT "Enter student name:" INPUT Name ENDWHILE CLOSEFILE "passed.txt"
评分标准
1 mark: Opening the file "passed.txt" for writing and closing it at the end using CLOSEFILE 1 mark: Inputting first student name before/at start of loop and inputting mark inside loop 1 mark: Loop with appropriate termination condition (e.g., WHILE Name <> "END") 1 mark: Correct conditional check IF Mark >= 50 1 mark: Writing only the name to the file inside the positive check branch
题目 6 · Pseudocode writing
5 分
A one-dimensional (1D) array named Rainfall contains 30 daily rainfall measurements (index 1 to 30) for a month. Write an algorithm in pseudocode to: 1. Find the maximum rainfall recorded during the month. 2. Identify the day number (index) on which this maximum occurred. 3. Calculate the total rainfall for the entire month. 4. Output the maximum rainfall, the day number, and the total rainfall with appropriate messages.
查看答案详解收起答案详解
解题
MaxRain <- -1 MaxDay <- 0 TotalRain <- 0 FOR Day <- 1 TO 30 TotalRain <- TotalRain + Rainfall[Day] IF Rainfall[Day] > MaxRain THEN MaxRain <- Rainfall[Day] MaxDay <- Day ENDIF NEXT Day OUTPUT "Maximum rainfall was: ", MaxRain, " on day ", MaxDay OUTPUT "Total monthly rainfall was: ", TotalRain
评分标准
1 mark: Initialising tracking variables (MaxRain to a low/negative value, TotalRain to 0) 1 mark: A count-controlled loop running from 1 to 30 to iterate through the array 1 mark: Correctly accumulating the TotalRain by adding each array element 1 mark: Comparing array element to MaxRain and updating both MaxRain and MaxDay with the current loop index 1 mark: Outputting the final maximum value, its index (day), and total rainfall with appropriate descriptive messages
题目 7 · Pseudocode writing
5 分
A program requires a user to set a secure password. The password must be validated according to the following rules: - It must be exactly 8 characters long - It must not be equal to the string "password"
Write an algorithm in pseudocode that repeatedly prompts the user and inputs a password until a valid password is entered. Once a valid password is provided, the algorithm must output "Password accepted".
查看答案详解收起答案详解
解题
REPEAT OUTPUT "Please enter a secure password:" INPUT UserPassword LengthValid <- (LENGTH(UserPassword) = 8) ContentValid <- (UserPassword <> "password") IF NOT LengthValid OR NOT ContentValid THEN OUTPUT "Invalid password. Try again." ENDIF UNTIL LengthValid AND ContentValid OUTPUT "Password accepted"
评分标准
1 mark: Use of a post-conditioned or pre-conditioned loop to repeat the input process 1 mark: Prompting for and inputting the password inside/at the start of the loop 1 mark: Checking the length of the password is exactly 8 characters using LENGTH() 1 mark: Checking that the password does not equal the forbidden word "password" 1 mark: Correct logical connection to exit loop only when both conditions are met, and outputting "Password accepted"
题目 8 · Pseudocode writing
5 分
A one-dimensional (1D) array called Scores contains 100 test scores (integer values from 0 to 100). Write an algorithm in pseudocode to: 1. Count how many scores are a distinction (75 or above). 2. Count how many scores are a fail (less than 40). 3. Calculate the percentage of scores that are distinctions and the percentage that are fails. 4. Output both percentages with suitable descriptive messages.
查看答案详解收起答案详解
解题
Distinctions <- 0 Fails <- 0 FOR i <- 1 TO 100 IF Scores[i] >= 75 THEN Distinctions <- Distinctions + 1 ELSE IF Scores[i] < 40 THEN Fails <- Fails + 1 ENDIF ENDIF NEXT i PctDist <- (Distinctions / 100) * 100 PctFail <- (Fails / 100) * 100 OUTPUT "Percentage of distinctions: ", PctDist, "%" OUTPUT "Percentage of fails: ", PctFail, "%"
评分标准
1 mark: Initialising count variables (Distinctions and Fails set to 0) 1 mark: Count-controlled loop iterating exactly 100 times (from 1 to 100) 1 mark: Correct conditional checks on array elements (Scores[i] >= 75 and Scores[i] < 40) incrementing appropriate counters 1 mark: Correct calculation of percentages outside the loop (dividing counts by 100 and multiplying by 100) 1 mark: Outputting both calculated percentages with descriptive messages
题目 9 · practical
15 分
A regional environmental agency monitors daily rainfall (in mm) for three different agricultural sectors over a 30-day period.
The two-dimensional (2D) array RainfallData[] stores each rainfall measurement. The first dimension (1 to 3) represents the sector number, and the second dimension (1 to 30) stores the daily rainfall values.
The monitoring process is handled as follows: - The name of each of the three sectors must be entered and validated. - For each sector, 30 daily rainfall values (real numbers between 0.0 and 80.0 inclusive) are generated randomly and stored in the array. - The total rainfall for each sector over the 30 days is calculated and stored. - The sector with the highest total rainfall is identified. If two or more sectors have the exact same highest total rainfall, a tie-breaker is used where the sector with the single highest daily rainfall is chosen as the overall wettest sector.
Write a program that meets the following requirements: - input and validate the names of the three sectors (each name must be at least 3 characters long and all three names must be unique) - generate 30 random real numbers between 0.0 and 80.0 inclusive for each sector and store them in the array RainfallData[] - calculate and store the total rainfall for each sector - determine the overall wettest sector (handling any ties as described) and output its name and total rainfall with an appropriate winner message - output the name and total rainfall for all three sectors in descending order of their total rainfall.
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to declare any arrays or variables; assume that this has already been done.
All outputs must contain suitable messages.
查看答案详解收起答案详解
解题
// Input and validate sector names FOR i <- 1 TO 3 REPEAT OUTPUT "Enter name for Sector ", i INPUT SectorName[i] Valid <- TRUE IF LENGTH(SectorName[i]) < 3 THEN Valid <- FALSE OUTPUT "Error: Name must be at least 3 characters long." ENDIF // Check for uniqueness against previous entries FOR j <- 1 TO i - 1 IF SectorName[i] = SectorName[j] THEN Valid <- FALSE OUTPUT "Error: Name must be unique." ENDIF NEXT j UNTIL Valid = TRUE NEXT i
// Initialize total and max rainfall tracking arrays FOR i <- 1 TO 3 TotalRain[i] <- 0.0 MaxDayRain[i] <- 0.0 NEXT i
// Generate random daily rainfall values and calculate statistics FOR i <- 1 TO 3 FOR day <- 1 TO 30 // Generate random real number between 0.0 and 80.0 inclusive RainfallData[i, day] <- RANDOM() * 80.0 TotalRain[i] <- TotalRain[i] + RainfallData[i, day]
// Track the single highest daily rainfall for the tie-breaker IF RainfallData[i, day] > MaxDayRain[i] THEN MaxDayRain[i] <- RainfallData[i, day] ENDIF NEXT day NEXT i
// Determine the overall wettest sector with tie-breaker logic WettestIndex <- 1 FOR i <- 2 TO 3 IF TotalRain[i] > TotalRain[WettestIndex] THEN WettestIndex <- i ELSE // Handle tie-breaker IF TotalRain[i] = TotalRain[WettestIndex] THEN IF MaxDayRain[i] > MaxDayRain[WettestIndex] THEN WettestIndex <- i ENDIF ENDIF ENDIF NEXT i
OUTPUT "The overall wettest agricultural sector is ", SectorName[WettestIndex], " with a total rainfall of ", TotalRain[WettestIndex], " mm."
// Sort and output in descending order of total rainfall (simple bubble sort for 3 items) Order[1] <- 1 Order[2] <- 2 Order[3] <- 3
FOR p <- 1 TO 2 FOR q <- 1 TO 2 Idx1 <- Order[q] Idx2 <- Order[q+1] IF TotalRain[Idx1] < TotalRain[Idx2] THEN Temp <- Order[q] Order[q] <- Order[q+1] Order[q+1] <- Temp ENDIF NEXT q NEXT p
OUTPUT "--- SECTOR RAINFALL REPORT (Descending Order) ---" FOR i <- 1 TO 3 Idx <- Order[i] OUTPUT "Sector Name: ", SectorName[Idx], " | Total Rainfall: ", TotalRain[Idx], " mm" NEXT i
评分标准
AO2: Apply knowledge and understanding (Max 9 marks) - 7-9 marks: The range of programming techniques used is highly appropriate. All requirements are fully addressed with correct 2D array references and complex logic (tie-breaker and sorting). - 4-6 marks: Some programming techniques used are appropriate. More than one requirement is met, but there are minor logic errors in tie-breaker, sorting, or validation. - 1-3 marks: At least one programming technique used (e.g. basic input or 1D array iteration), but major requirements remain unaddressed.
AO3: Provide solutions to problems (Max 6 marks) - 5-6 marks: The program is fully commented. Meaningful identifiers are used throughout. The solution is logically ordered and accurate. - 3-4 marks: Some comments are included. Most identifiers are meaningful. The solution contains minor inaccuracies or slight structural flaws. - 1-2 marks: Few or no comments. Identifiers are unclear and the solution structure is illogical.
Detailed breakdown of functional marks for guidance: - R1: Input and validate sector names (Max 4 marks) * Inputting 3 sector names in a loop. * Validation check for minimum length (>= 3 characters). * Validation check for uniqueness against previously entered names. * Repetition loop to re-enter name if validation fails. - R2: Generation and storage (Max 4 marks) * Outer loop for sectors (1 to 3) and inner loop for days (1 to 30). * Correct assignment to a 2D array structure: RainfallData[sector, day]. * Accumulating total rainfall for each sector. * Correct tracking of maximum single-day rainfall for each sector. - R3: Logic, Tie-breaker, and Sorting (Max 4 marks) * Comparing total rainfalls to identify the maximum. * Correct conditional block to evaluate MaxDayRain in case of a tie. * Sorting the sectors in descending order of total rainfall. * Outputting final sorted details and winner with appropriate text messages.
题目 10 · open-response
3 分
A local fitness center uses a database table named `MemberActivity` to record daily workouts. The table contains the following fields: - `MemberID` - `FullName` - `ActivityType` - `DurationMinutes` - `TrainerRequired`
Write a structured query language (SQL) statement to display the `FullName` and `ActivityType` of all members who worked out for more than 45 minutes and do not require a trainer (`TrainerRequired` is 'No').
查看答案详解收起答案详解
解题
To complete this query, select the `FullName` and `ActivityType` fields from the `MemberActivity` table. The conditions in the WHERE clause must check that `DurationMinutes` is greater than 45 and that `TrainerRequired` is equal to 'No'.
```sql SELECT FullName, ActivityType FROM MemberActivity WHERE DurationMinutes > 45 AND TrainerRequired = 'No'; ```
评分标准
One mark per correct SQL line: - SELECT FullName, ActivityType (1 mark) - FROM MemberActivity (1 mark) - WHERE DurationMinutes > 45 AND TrainerRequired = 'No'; (1 mark - accept single, double, or no quotes around No; accept lowercase/uppercase SQL keywords)
题目 11 · open-response
2 分
An online bookstore uses a database table named `BookStock` to manage its inventory. The table contains the following fields: - `ISBN` - `Title` - `Author` - `Genre` - `Price` - `QuantityInStock`
(i) Identify which field would be most appropriate to use as a primary key. [1]
(ii) State the reason why this field is the most appropriate choice. [1]
查看答案详解收起答案详解
解题
(i) `ISBN` is the correct field. (ii) An ISBN (International Standard Book Number) uniquely identifies each book published worldwide. Other fields like Title, Author, or Genre can contain duplicate values across multiple records.
评分标准
- (i) 1 mark for identifying ISBN. - (ii) 1 mark for explaining that it is a unique identifier / uniquely identifies each book record / contains no repeating or duplicate data.
想知道自己有几分把握?
thinka 是 DSE 学生在用的 AI 练习应用,提供无限量练习题、即时自动批改和详细解题步骤。超过 100,000 名学生用它确认自己是真的会,而不只是「以为会」。