HKDSE · Answers & Marking Scheme

2021 HKDSE Information and Communication Technology Answers & Marking Scheme

Thinka 2021 DSE-Style Mock — Information and Communication Technology

90 marks120 mins2021
An original Thinka practice paper modelled on the structure and difficulty of that year's HKDSE paper. Not affiliated with or reproduced from the HKEAA.

Section A

Answer all 40 multiple-choice questions. All questions carry equal marks.
40 Question · 40 marks
Question 1 · MCQ
1 marks
What is the decimal value represented by the 8-bit binary string after performing the addition \(01011100_2 + 00111010_2\) in an 8-bit signed two's complement system?
  1. A.150
  2. B.-106
  3. C.-105
  4. D.-92

Answer

B

Worked solution

1. Convert the binary numbers to decimal to see if overflow occurs: \(01011100_2 = 92_{10}\), \(00111010_2 = 58_{10}\). The sum is \(92 + 58 = 150\). Since the maximum value in an 8-bit signed integer is \(+127\), overflow occurs.\n2. Perform binary addition: \(01011100_2 + 00111010_2 = 10010110_2\).\n3. In 8-bit signed two's complement, the most significant bit (MSB) is 1, indicating a negative number.\n4. Find the magnitude by taking the two's complement of \(10010110_2\): Invert bits: \(01101001_2\), add 1: \(01101010_2 = 64 + 32 + 8 + 2 = 106\). Thus, the value is \(-106\).

Marking scheme

Award 1 mark for the correct option (B). No partial marks.
Question 2 · MCQ
1 marks
Consider the following algorithm in pseudocode:\n\n```\nA = 5\nB = 3\nC = 0\nWhile A > 0 do\n If A mod 2 == 1 then\n C = C + B\n B = B * 2\n A = A div 2\n```\n\nWhat is the value of `C` when the algorithm finishes?
  1. A.3
  2. B.9
  3. C.15
  4. D.24

Answer

C

Worked solution

Let's trace the loop execution:\n- Initial: `A = 5`, `B = 3`, `C = 0`.\n- Iteration 1: `A = 5 > 0`. Since `5 mod 2 == 1`, `C = 0 + 3 = 3`. Then `B = 3 * 2 = 6`, `A = 5 div 2 = 2`.\n- Iteration 2: `A = 2 > 0`. Since `2 mod 2 == 0`, `C` remains `3`. Then `B = 6 * 2 = 12`, `A = 2 div 2 = 1`.\n- Iteration 3: `A = 1 > 0`. Since `1 mod 2 == 1`, `C = 3 + 12 = 15`. Then `B = 12 * 2 = 24`, `A = 1 div 2 = 0`.\n- Loop ends as `A` is now `0`. The final value of `C` is `15`.

Marking scheme

Award 1 mark for the correct option (C).
Question 3 · MCQ
1 marks
Which of the following statements about cache memory in a computer system are correct?\n\n(1) Cache memory is faster than RAM but slower than CPU registers.\n(2) Cache memory is non-volatile.\n(3) Cache memory stores frequently used data and instructions to speed up CPU processing.
  1. A.(1) and (2) only
  2. B.(1) and (3) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)

Answer

B

Worked solution

Statement (1) is correct: Registers are the fastest, followed by cache memory, then main memory (RAM).\nStatement (2) is incorrect: Cache memory is made of static RAM (SRAM), which is volatile memory and loses its content when power is turned off.\nStatement (3) is correct: The purpose of cache memory is to keep recently or frequently used instructions/data close to the CPU to reduce access latency.\nTherefore, (1) and (3) are correct.

Marking scheme

Award 1 mark for the correct option (B).
Question 4 · MCQ
1 marks
An IP address is `192.168.10.45` with a subnet mask of `255.255.255.240`. Which of the following IP addresses is in the same subnet as this IP address?
  1. A.192.168.10.28
  2. B.192.168.10.31
  3. C.192.168.10.42
  4. D.192.168.10.48

Answer

C

Worked solution

1. The subnet mask `255.255.255.240` has a last octet of `240` (`11110000` in binary).\n2. This means the block size of each subnet is \(256 - 240 = 16\).\n3. The subnets start at multiples of 16: `0`, `16`, `32`, `48`, `64`...\n4. For `192.168.10.45`, the last octet is `45`. This falls in the range of the subnet starting at `32`, which spans from `192.168.10.32` to `192.168.10.47`.\n5. Checking the options, only `192.168.10.42` (with last octet `42`) is between `32` and `47`.

Marking scheme

Award 1 mark for the correct option (C).
Question 5 · MCQ
1 marks
Consider the following database schema for a school enrollment system:\n\n`STUDENT(StudentID, StudentName, Class)`\n`COURSE(CourseID, CourseName, Teacher)`\n`ENROLLMENT(StudentID, CourseID, EnrollDate, Grade)`\n\nWhich of the following statements is/are correct?\n\n(1) The primary key of `ENROLLMENT` should be the composite key `(StudentID, CourseID)`.\n(2) `StudentID` in `ENROLLMENT` is a foreign key referencing `STUDENT`.\n(3) `StudentID` in `STUDENT` must be unique and cannot contain null values.
  1. A.(1) and (2) only
  2. B.(1) and (3) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)

Answer

D

Worked solution

Statement (1) is correct: The `ENROLLMENT` table represents a many-to-many relationship between `STUDENT` and `COURSE`. Its composite primary key consists of `StudentID` and `CourseID` to uniquely identify each enrollment record.\nStatement (2) is correct: `StudentID` in `ENROLLMENT` links to `StudentID` in `STUDENT`, acting as a foreign key to maintain referential integrity.\nStatement (3) is correct: Since `StudentID` is the primary key of the `STUDENT` table, by definition of entity integrity, it must be unique and cannot be null.\nTherefore, all three statements are correct.

Marking scheme

Award 1 mark for the correct option (D).
Question 6 · MCQ
1 marks
In a spreadsheet, cell `B2` contains the formula `=$A$1 + B1`. If this formula is copied and pasted into cell `D4`, what will the formula in `D4` be?
  1. A.=$A$1 + B1
  2. B.=$C$3 + D3
  3. C.=$A$1 + D3
  4. D.=$A$1 + C3

Answer

C

Worked solution

1. `$A$1` is an absolute reference (indicated by the `$` signs). When copied, it does not change, remaining `$A$1`.\n2. `B1` is a relative reference. The formula is copied from `B2` to `D4`. This represents a shift of:\n - Column: `B` to `D` (+2 columns)\n - Row: `2` to `4` (+2 rows)\n3. Applying this shift to the relative reference `B1`:\n - Column `B` shifted by +2 columns becomes `D`.\n - Row `1` shifted by +2 rows becomes `3`.\n - Thus, `B1` becomes `D3`.\n4. The resulting formula in `D4` is `=$A$1 + D3`.

Marking scheme

Award 1 mark for the correct option (C).
Question 7 · MCQ
1 marks
If Alice wants to send a confidential message to Bob using public key cryptography, which key should Alice use to encrypt the message, and which key should Bob use to decrypt it?
  1. A.Alice encrypts with Alice's public key; Bob decrypts with Bob's private key.
  2. B.Alice encrypts with Bob's public key; Bob decrypts with Bob's private key.
  3. C.Alice encrypts with Bob's private key; Bob decrypts with Alice's public key.
  4. D.Alice encrypts with Alice's private key; Bob decrypts with Alice's public key.

Answer

B

Worked solution

To ensure confidentiality, only the intended recipient (Bob) should be able to decrypt the message. Since Bob is the only holder of Bob's private key, the sender (Alice) must encrypt the message using Bob's public key (which is publicly accessible). Bob then decrypts it using his private key.

Marking scheme

Award 1 mark for the correct option (B).
Question 8 · MCQ
1 marks
Which of the following are advantages of RFID technology over traditional optical barcodes?\n\n(1) RFID tags can be read without a direct line of sight.\n(2) Multiple RFID tags can be scanned and identified simultaneously.\n(3) RFID tags can store larger amounts of data and many can be read/written multiple times.
  1. A.(1) and (2) only
  2. B.(1) and (3) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)

Answer

D

Worked solution

All three statements are major advantages of RFID over traditional barcodes:\n- (1) RFID uses radio waves, so tags can be read even if covered or inside a box, whereas barcodes need optical line of sight.\n- (2) RFID readers can scan hundreds of tags simultaneously, while barcodes must be scanned one by one.\n- (3) RFID tags contain microchips that store more data and can be updated/re-written, unlike static printed barcodes.

Marking scheme

Award 1 mark for the correct option (D).
Question 9 · MCQ
1 marks
A student wrote a program to find the average of three positive integers. The program executed without any error messages, but it printed `7` instead of `5` when the inputs were `3`, `5`, and `7`. What type of error is this?
  1. A.Syntax error
  2. B.Runtime error
  3. C.Logical error
  4. D.Compilation error

Answer

C

Worked solution

A logical error occurs when a program compiles and runs successfully without crashing, but produces incorrect results. In this case, the program might have implemented the average formula incorrectly (e.g., `A + B + C / 3` instead of `(A + B + C) / 3`, which yields `3 + 5 + 7/3 = 8 + 2.33 = 10.33`, or another incorrect precedence/ordering formula that evaluates to `7`). Since there are no syntax errors or program crashes (runtime errors), it is a logical error.

Marking scheme

Award 1 mark for the correct option (C).
Question 10 · MCQ
1 marks
An uncompressed stereo (2 channels) audio track is recorded with a sampling rate of \(44.1 \text{ kHz}\) and a bit depth of \(16 \text{ bits}\). What is the file size of a 2-minute recording in megabytes (MB)? (Assume \(1 \text{ MB} = 10^6 \text{ bytes}\))
  1. A.5.3 MB
  2. B.10.6 MB
  3. C.21.2 MB
  4. D.42.3 MB

Answer

C

Worked solution

1. Identify the parameters:\n - Sampling rate = \(44.1 \text{ kHz} = 44,100 \text{ Hz}\)\n - Bit depth = \(16 \text{ bits} = 2 \text{ bytes}\)\n - Channels = 2 (stereo)\n - Duration = \(2 \text{ minutes} = 120 \text{ seconds}\)\n2. Calculate the total size in bytes:\n \(\text{File Size} = 44,100 \times 2 \text{ bytes} \times 2 \text{ channels} \times 120 \text{ seconds}\)\n \(\text{File Size} = 44,100 \times 4 \times 120 = 21,168,000 \text{ bytes}\)\n3. Convert to MB:\n \(21,168,000 \text{ bytes} \div 10^6 \approx 21.17 \text{ MB}\)\n4. This matches 21.2 MB (rounded to one decimal place).

Marking scheme

Award 1 mark for the correct option (C).
Question 11 · MCQ
1 marks
An 8-bit register represents signed integers using two's complement representation. What is the decimal value represented by the binary string \(11001011_2\)?
  1. A.-53
  2. B.-52
  3. C.-75
  4. D.203

Answer

A

Worked solution

The binary string is \(11001011_2\). Since the most significant bit (MSB) is 1, it represents a negative number. To find its magnitude, we find its two's complement: 1. Invert all bits: \(00110100_2\). 2. Add 1 to the result: \(00110100_2 + 1_2 = 00110101_2\). The decimal value of \(00110101_2\) is \(32 + 16 + 4 + 1 = 53\). Therefore, the signed decimal value is \(-53\).

Marking scheme

Award 1 mark for the correct answer A. Award 0 marks for other choices.
Question 12 · MCQ
1 marks
Which of the following statements about CPU cache memory is/are correct? (1) It is faster than DRAM but slower than CPU registers. (2) It uses SRAM. (3) It stores the most frequently used data and instructions to reduce the average cost of access from the main memory.
  1. A.(1) and (2) only
  2. B.(1) and (3) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)

Answer

D

Worked solution

All statements are correct. (1) Cache memory is positioned between registers and main memory (DRAM) in terms of speed. (2) Cache memory is implemented using Static RAM (SRAM) because of its high speed. (3) The purpose of cache is to store frequently used data and instructions to minimize access time compared to fetching from slower main memory.

Marking scheme

Award 1 mark for the correct answer D. Award 0 marks for other choices.
Question 13 · MCQ
1 marks
A computer has an IP address of \(192.168.10.45\) and a subnet mask of \(255.255.255.224\). Which of the following IP addresses is on the same local subnet as this computer?
  1. A.\(192.168.10.30\)
  2. B.\(192.168.10.50\)
  3. C.\(192.168.10.65\)
  4. D.\(192.168.10.128\)

Answer

B

Worked solution

The subnet mask \(255.255.255.224\) splits the last octet into subnets of block size \(32\) (since \(256 - 224 = 32\)). The subnet ranges are: Subnet 0: \(192.168.10.0\) to \(.31\); Subnet 1: \(192.168.10.32\) to \(.63\); Subnet 2: \(192.168.10.64\) to \(.95\), etc. Since the computer's IP is \(192.168.10.45\), it belongs to Subnet 1 (range \(.32\) to \(.63\)). Among the choices, \(192.168.10.50\) also falls within the range of Subnet 1, while other options belong to different subnets.

Marking scheme

Award 1 mark for the correct answer B. Award 0 marks for other choices.
Question 14 · MCQ
1 marks
Consider the following pseudocode segment: `X = 7`, `Y = 3`, `result = 0`. `while X > 0 do:` `if X % 2 != 0 then result = result + Y`, `X = X div 2`, `Y = Y * 2`. What is the value of `result` after execution? (Note: `div` represents integer division and `%` represents the modulo operator.)
  1. A.9
  2. B.15
  3. C.21
  4. D.24

Answer

C

Worked solution

Let's trace the loop step-by-step: Initially: X = 7, Y = 3, result = 0. Iteration 1: X > 0 (7 > 0) is true. Since 7 % 2 != 0 is true, result = 0 + 3 = 3. X = 7 div 2 = 3. Y = 3 * 2 = 6. Iteration 2: X > 0 (3 > 0) is true. Since 3 % 2 != 0 is true, result = 3 + 6 = 9. X = 3 div 2 = 1. Y = 6 * 2 = 12. Iteration 3: X > 0 (1 > 0) is true. Since 1 % 2 != 0 is true, result = 9 + 12 = 21. X = 1 div 2 = 0. Y = 12 * 2 = 24. Iteration 4: X > 0 (0 > 0) is false. The loop terminates. The final value of result is 21.

Marking scheme

Award 1 mark for the correct answer C. Award 0 marks for other choices.
Question 15 · MCQ
1 marks
In a spreadsheet, cell B2 contains the formula `=$A2 + B$1`. If cell B2 is copied and pasted into cell D4, what formula will be displayed in cell D4?
  1. A.`=$A4 + D$1`
  2. B.`=$C4 + D$1`
  3. C.`=$A4 + B$1`
  4. D.`=$A2 + D$3`

Answer

A

Worked solution

The formula contains mixed cell references. Copied from B2 to D4, the column changes by +2 (B to D) and the row changes by +2 (2 to 4). Let's analyze both parts: 1. `=$A2`: The column A is absolute (`$A`), so it remains `$A`. The row 2 is relative and increases by +2, becoming `4`. Thus, it becomes `=$A4`. 2. `+ B$1`: The column B is relative and changes by +2, becoming `D`. The row 1 is absolute (`$1`), so it remains `$1`. Thus, it becomes `+ D$1`. Combining them gives `=$A4 + D$1`.

Marking scheme

Award 1 mark for the correct answer A. Award 0 marks for other choices.
Question 16 · MCQ
1 marks
Consider two relational database tables: `STUDENT` (`StudentID`, `Name`, `ClassID`) where `StudentID` is the primary key and `ClassID` is a foreign key referencing the `CLASS` table, and `CLASS` (`ClassID`, `ClassName`, `Teacher`) where `ClassID` is the primary key. Which of the following operations violates referential integrity?
  1. A.Inserting a new record into `STUDENT` with a `ClassID` that does not exist in the `CLASS` table.
  2. B.Deleting a record from `STUDENT`.
  3. C.Inserting a new record into `CLASS` with a new `ClassID`.
  4. D.Updating the `Teacher` field of an existing record in the `CLASS` table.

Answer

A

Worked solution

Referential integrity requires that any foreign key field in a child table (in this case, `ClassID` in `STUDENT`) must match a primary key value in the parent table (`CLASS`), or be null. Inserting a new record into `STUDENT` with a `ClassID` that does not exist in the `CLASS` table violates this constraint because there is no corresponding class. Other options like deleting a student record, inserting a class, or updating non-key fields do not violate referential integrity.

Marking scheme

Award 1 mark for the correct answer A. Award 0 marks for other choices.
Question 17 · MCQ
1 marks
Alice wants to send an encrypted message to Bob to ensure confidentiality, and she also wants to attach a digital signature to guarantee the authenticity of the message. To achieve both confidentiality and authenticity, Alice should encrypt the message and create the digital signature using which keys?
  1. A.Encrypt the message with Bob's public key, and sign with Alice's private key.
  2. B.Encrypt the message with Alice's public key, and sign with Bob's private key.
  3. C.Encrypt the message with Bob's private key, and sign with Alice's public key.
  4. D.Encrypt the message with Alice's private key, and sign with Bob's public key.

Answer

A

Worked solution

To ensure confidentiality, only Bob should be able to decrypt the message, so Alice must encrypt the message using Bob's public key. To ensure authenticity (digital signature), Alice must sign (encrypt a hash of) the message using Alice's private key, because only Alice has her private key and anybody can verify it using Alice's public key. Therefore, option A is correct.

Marking scheme

Award 1 mark for the correct answer A. Award 0 marks for other choices.
Question 18 · MCQ
1 marks
A program accepts an integer input \(N\) representing a student's mark (\(0 \le N \le 100\)). It outputs "Pass" if \(N \ge 50\) and "Fail" otherwise. A programmer wants to perform Boundary Value Analysis (BVA) to design test cases. Which of the following sets of values for \(N\) represents the best boundary test cases?
  1. A.\(-1, 0, 49, 50, 100, 101\)
  2. B.\(0, 50, 100\)
  3. C.\(-10, 50, 150\)
  4. D.\(0, 1, 49, 50, 51, 99, 100\)

Answer

A

Worked solution

Boundary Value Analysis focuses on the boundaries of input domains and decision thresholds. The boundaries of the valid input domain \([0, 100]\) are 0 and 100, so we test \(-1\) (invalid boundary), \(0\) (valid boundary), \(100\) (valid boundary), and \(101\) (invalid boundary). The decision boundary for passing is at \(50\), so we test \(49\) (just below the boundary, fails) and \(50\) (exactly on the boundary, passes). Therefore, the set \(\{-1, 0, 49, 50, 100, 101\}\) is the most comprehensive.

Marking scheme

Award 1 mark for the correct answer A. Award 0 marks for other choices.
Question 19 · MCQ
1 marks
Which of the following is an example of a data verification method rather than a data validation method?
  1. A.Double entry
  2. B.Range check
  3. C.Format check
  4. D.Check digit

Answer

A

Worked solution

Data verification is the process of checking that data has been copied accurately from one medium to another (e.g. comparing the entered data with the original source document). Double entry (where the same data is typed in twice by two different people or twice by the same person, and compared) is a key method of data verification. Range check, format check, and check digits are all automated validation checks that evaluate whether the entered data conforms to specific system constraints/rules.

Marking scheme

Award 1 mark for the correct answer A. Award 0 marks for other choices.
Question 20 · MCQ
1 marks
Which of the following are advantages of Radio Frequency Identification (RFID) technology over Barcode technology? (1) RFID tags can be read without a direct line of sight. (2) Multiple RFID tags can be scanned simultaneously. (3) RFID tags can store read-write data, whereas traditional barcodes are read-only.
  1. A.(1) and (2) only
  2. B.(1) and (3) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)

Answer

D

Worked solution

All statements are correct. (1) Unlike barcodes which require optical line-of-sight scanning, RFID tags communicate via radio waves and do not require direct line-of-sight. (2) RFID readers can identify and scan hundreds of tags simultaneously, whereas barcodes must be scanned one by one. (3) Traditional printed barcodes are read-only and static once printed, whereas RFID tags can have writeable memory allowing data updates.

Marking scheme

Award 1 mark for the correct answer D. Award 0 marks for other choices.
Question 21 · MCQ
1 marks
In an 8-bit two's complement binary system, what is the representation of the decimal value \(-43\)?
  1. A.11010101
  2. B.10101011
  3. C.11010100
  4. D.00101011

Answer

A

Worked solution

1. Express the positive counterpart \(+43\) in 8-bit binary: \(43 = 32 + 8 + 2 + 1 = 00101011_2\).
2. Find the one's complement by inverting all bits: \(11010100_2\).
3. Find the two's complement by adding 1: \(11010100_2 + 1 = 11010101_2\). Therefore, the correct option is A.

Marking scheme

1 mark for the correct answer (A). 0 marks for incorrect answers.
Question 22 · MCQ
1 marks
Which of the following statements about cache memory in a computer system is/are correct?
(1) Cache memory is faster than RAM because it is located closer to or inside the CPU.
(2) Cache memory has a larger capacity than RAM to store more executing program instructions.
(3) Cache memory is non-volatile, retaining data even when the computer is powered off.
  1. A.(1) only
  2. B.(2) only
  3. C.(1) and (3) only
  4. D.(2) and (3) only

Answer

A

Worked solution

Statement (1) is correct: Cache memory uses high-speed SRAM and is physically closer to or on the CPU, making it much faster than RAM.
Statement (2) is incorrect: Cache memory is expensive and limited in size, so its capacity is much smaller than RAM.
Statement (3) is incorrect: Cache memory is volatile and loses its data when powered off. Therefore, only (1) is correct.

Marking scheme

1 mark for the correct answer (A). 0 marks for incorrect answers.
Question 23 · MCQ
1 marks
Consider the following algorithm written in pseudocode:
```
X = 14
Y = 4
result = 0
while X >= Y do
X = X - Y
result = result + 1
endwhile
```
What are the values of `X` and `result` after the execution of the algorithm?
  1. A.X = 0, result = 3
  2. B.X = 2, result = 3
  3. C.X = 2, result = 4
  4. D.X = 14, result = 3

Answer

B

Worked solution

Let's trace the loop execution:
- Initial state: X = 14, Y = 4, result = 0
- Iteration 1 (14 >= 4 is True): X = 14 - 4 = 10, result = 0 + 1 = 1
- Iteration 2 (10 >= 4 is True): X = 10 - 4 = 6, result = 1 + 1 = 2
- Iteration 3 (6 >= 4 is True): X = 6 - 4 = 2, result = 2 + 1 = 3
- Iteration 4 (2 >= 4 is False): Loop terminates.
At the end, X = 2 and result = 3.

Marking scheme

1 mark for the correct answer (B). 0 marks for incorrect answers.
Question 24 · MCQ
1 marks
A company wants to assign IP addresses to its host computers. Which of the following IP addresses can be assigned to a host computer on a private local area network (LAN)?
  1. A.127.0.0.1
  2. B.192.168.1.0
  3. C.172.16.10.25
  4. D.224.0.0.1

Answer

C

Worked solution

Option A (127.0.0.1) is the localhost loopback address.
Option B (192.168.1.0) is a network address where all host bits are 0, which cannot be assigned to an active host.
Option C (172.16.10.25) is a valid, assignable IP address within the private Class B block (172.16.0.0 – 172.31.255.255).
Option D (224.0.0.1) is reserved for multicast. Thus, only C is a valid assignable host IP.

Marking scheme

1 mark for the correct answer (C). 0 marks for incorrect answers.
Question 25 · MCQ
1 marks
A spreadsheet contains the following data:
- Cell A1: 10, Cell B1: 2
- Cell A2: 20, Cell B2: 4
- Cell A3: 30, Cell B3: 5

The formula `=$A1+B$1` is entered in cell C1 and then copied to cell D3. What is the value displayed in cell D3?
  1. A.32
  2. B.35
  3. C.42
  4. D.15

Answer

C

Worked solution

1. Evaluate C1 first: `=$A1+B$1` which means `=A1 + B1` = 10 + 2 = 12.
2. When copying from C1 to D3:
- Column changes from C to D (right by 1 column).
- Row changes from 1 to 3 (down by 2 rows).
3. In the formula `=$A1+B$1`:
- `$A` has an absolute column reference, so it remains `$A`. Row `1` is relative, so it becomes `1 + 2 = 3`. Thus, `$A1` becomes `$A3`.
- `B` is a relative column reference, so it becomes `B` shifted by 1 column = `C`. `$1` has an absolute row reference, so it remains `$1`. Thus, `B$1` becomes `C$1`.
4. The formula in D3 becomes `=$A3+C$1`.
5. `$A3` contains 30. `C$1` (cell C1) contains 12. Therefore, D3 = 30 + 12 = 42.

Marking scheme

1 mark for the correct answer (C). 0 marks for incorrect answers.
Question 26 · MCQ
1 marks
An audio file is recorded with a sampling rate of 44.1 kHz, 16-bit resolution, and in stereo (2 channels). What is the estimated file size, in megabytes (MB), of a 5-minute uncompressed recording?
  1. A.\(\frac{44100 \times 16 \times 2 \times 300}{8 \times 1024 \times 1024}\)
  2. B.\(\frac{44100 \times 16 \times 300}{8 \times 1024 \times 1024}\)
  3. C.\(\frac{44100 \times 16 \times 2 \times 5}{8 \times 1024 \times 1024}\)
  4. D.\(\frac{44100 \times 16 \times 2 \times 300}{1024 \times 1024}\)

Answer

A

Worked solution

1. Sampling rate = 44,100 Hz.
2. Resolution = 16 bits.
3. Channels = 2.
4. Duration = 5 minutes = 300 seconds.
5. Total bits = \(44100 \times 16 \times 2 \times 300\).
6. Convert to bytes: divide by 8.
7. Convert to MB: divide by \(1024 \times 1024\).
Thus, the expression is \(\frac{44100 \times 16 \times 2 \times 300}{8 \times 1024 \times 1024}\) MB.

Marking scheme

1 mark for the correct answer (A). 0 marks for incorrect answers.
Question 27 · MCQ
1 marks
During the fetch stage of the machine cycle, which register stores the address of the next instruction to be executed?
  1. A.Program Counter (PC)
  2. B.Instruction Register (IR)
  3. C.Memory Address Register (MAR)
  4. D.Accumulator (ACC)

Answer

A

Worked solution

The Program Counter (PC) keeps track of the memory address of the next instruction to be executed. The Instruction Register (IR) holds the current instruction. The Memory Address Register (MAR) holds the memory address currently being accessed. The Accumulator (ACC) stores arithmetic results.

Marking scheme

1 mark for the correct answer (A). 0 marks for incorrect answers.
Question 28 · MCQ
1 marks
An array of 1,000 elements is sorted in ascending order. If we use the binary search algorithm to search for a specific target value in this array, what is the maximum number of comparisons needed?
  1. A.10
  2. B.500
  3. C.1,000
  4. D.1,024

Answer

A

Worked solution

Binary search repeatedly divides the search space in half. The maximum number of comparisons to search a sorted list of size \(N\) is given by \(\lfloor\log_2(N)\rfloor + 1\). For \(N = 1000\), since \(2^9 = 512 < 1000 \le 1024 = 2^{10}\), the worst-case number of comparisons is 10.

Marking scheme

1 mark for the correct answer (A). 0 marks for incorrect answers.
Question 29 · MCQ
1 marks
When a smartphone connects to a public Wi-Fi network, which protocol is responsible for automatically assigning a temporary IP address, subnet mask, and default gateway to the device?
  1. A.DNS
  2. B.DHCP
  3. C.HTTP
  4. D.ARP

Answer

B

Worked solution

DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses, subnet masks, gateways, and other network settings to client devices. DNS resolves domain names. HTTP is used for web browsing. ARP maps IP addresses to physical MAC addresses.

Marking scheme

1 mark for the correct answer (B). 0 marks for incorrect answers.
Question 30 · MCQ
1 marks
To ensure the accuracy of data entry in a database, a developer implements two measures:
(1) Entering the password twice during registration to ensure they match.
(2) Checking if the entered age is a positive integer between 0 and 150.

Which types of data checks are (1) and (2) respectively?
  1. A.(1) Data validation; (2) Data validation
  2. B.(1) Data validation; (2) Data verification
  3. C.(1) Data verification; (2) Data validation
  4. D.(1) Data verification; (2) Data verification

Answer

C

Worked solution

Measure (1) involves double entry of the same data to check for human keying errors, which is a method of data verification (double-entry check).
Measure (2) involves setting rules (range check and data type check) within the system to ensure the values are sensible before being accepted, which is data validation.
Hence, (1) is data verification and (2) is data validation.

Marking scheme

1 mark for the correct answer (C). 0 marks for incorrect answers.
Question 31 · MCQ
1 marks
An 8-bit register stores integers in 2's complement representation. What is the result in decimal when the bitwise XOR operation is performed between the representation of -18 and 35, and then interpreted as a signed 8-bit integer?
  1. A.-51
  2. B.-53
  3. C.51
  4. D.-17

Answer

A

Worked solution

First, convert -18 and 35 to 8-bit signed 2's complement representation:
-18: +18 is 00010010. 1's complement is 11101101. 2's complement is 11101110.
35: +35 is 00100011.
Bitwise XOR:
11101110 XOR 00100011 = 11001101.
Convert 11001101 back to decimal as a signed 8-bit integer:
Since the MSB is 1, it is a negative number. Its absolute value is found by taking its 2's complement:
11001101 -> Subtract 1: 11001100 -> Invert bits: 00110011 (which is 51 in decimal).
Therefore, the decimal value is -51.

Marking scheme

Award 1 mark for the correct answer A. No fractional marks are given.
Question 32 · MCQ
1 marks
Consider the following pseudo-code:

`X = 0`
`For I from 1 to 4:`
` For J from I to 4:`
` If (I + J) is even then:`
` X = X + I`
` Else:`
` X = X + J`

What is the value of `X` after executing the algorithm?
  1. A.20
  2. B.24
  3. C.26
  4. D.30

Answer

C

Worked solution

Trace the nested loop:
- I = 1:
- J = 1: I+J = 2 (even) -> X = 0 + 1 = 1
- J = 2: I+J = 3 (odd) -> X = 1 + 2 = 3
- J = 3: I+J = 4 (even) -> X = 3 + 1 = 4
- J = 4: I+J = 5 (odd) -> X = 4 + 4 = 8
- I = 2:
- J = 2: I+J = 4 (even) -> X = 8 + 2 = 10
- J = 3: I+J = 5 (odd) -> X = 10 + 3 = 13
- J = 4: I+J = 6 (even) -> X = 13 + 2 = 15
- I = 3:
- J = 3: I+J = 6 (even) -> X = 15 + 3 = 18
- J = 4: I+J = 7 (odd) -> X = 18 + 4 = 22
- I = 4:
- J = 4: I+J = 8 (even) -> X = 22 + 4 = 26
Thus, X = 26.

Marking scheme

Award 1 mark for the correct answer C. No fractional marks are given.
Question 33 · MCQ
1 marks
A computer system is upgraded by increasing its data bus width from 32-bit to 64-bit, while the clock frequency is reduced from \(3.2 \text{ GHz}\) to \(2.0 \text{ GHz}\). Assuming that the CPU can fetch one word per bus cycle and all other factors remain constant, what is the ratio of the theoretical maximum data transfer rate of the new system's data bus to that of the old system?
  1. A.0.625
  2. B.0.8
  3. C.1.25
  4. D.1.6

Answer

C

Worked solution

Theoretical Maximum Data Transfer Rate = Bus Width (in bytes) * Clock Frequency.
For the old system:
Bus Width = 32 bits = 4 bytes.
Transfer Rate_old = 4 bytes * 3.2 GHz = 12.8 GB/s.
For the new system:
Bus Width = 64 bits = 8 bytes.
Transfer Rate_new = 8 bytes * 2.0 GHz = 16.0 GB/s.
Ratio = 16.0 / 12.8 = 1.25.

Marking scheme

Award 1 mark for the correct answer C. No fractional marks are given.
Question 34 · MCQ
1 marks
An organization is assigned the IP address range 192.168.10.0/24. If they need to divide this network into exactly 4 subnets of equal size, which of the following represents the valid subnet mask and the maximum number of usable host IP addresses in each subnet?
  1. A.Subnet Mask: 255.255.255.192, Usable Hosts: 62
  2. B.Subnet Mask: 255.255.255.192, Usable Hosts: 64
  3. C.Subnet Mask: 255.255.255.224, Usable Hosts: 30
  4. D.Subnet Mask: 255.255.255.224, Usable Hosts: 32

Answer

A

Worked solution

To divide a class C network /24 into exactly 4 subnets of equal size, we need to borrow 2 bits from the host portion since 2^2 = 4. This changes the prefix from /24 to /26.
- Subnet mask: /26 corresponds to 255.255.255.192.
- Total IP addresses per subnet = 2^(32-26) = 2^6 = 64.
- Maximum number of usable host IP addresses per subnet = 64 - 2 = 62 (as network address and broadcast address cannot be assigned to hosts).

Marking scheme

Award 1 mark for the correct answer A. No fractional marks are given.
Question 35 · MCQ
1 marks
In a spreadsheet, cell A1 contains the formula `=$B1+C$2`. If we copy this formula and paste it into cell D3, what is the formula in D3?
  1. A.=$B3+F$2
  2. B.=$E3+F$2
  3. C.=$B3+C$2
  4. D.=$E1+C$2

Answer

A

Worked solution

When copying a formula to a new cell:
- Absolute references (indicated by $) remain unchanged.
- Relative references shift by the distance between the source and target cells.
The shift from A1 to D3 is +3 columns (A to D) and +2 rows (1 to 3).
- `$B1`: Column B is absolute ($B), so it stays $B. Row 1 is relative, so it shifts by +2 to become 3. Thus, `$B1` becomes `$B3`.
- `C$2`: Column C is relative, so it shifts by +3 to become F. Row 2 is absolute ($2), so it stays $2. Thus, `C$2` becomes `F$2`.
Therefore, the formula in D3 is `=$B3+F$2`.

Marking scheme

Award 1 mark for the correct answer A. No fractional marks are given.
Question 36 · MCQ
1 marks
Alice wants to send a confidential and digitally signed document to Bob using asymmetric key cryptography. Which keys should Alice use to sign the document and encrypt the document respectively?
  1. A.Alice's private key for signing, Bob's public key for encryption
  2. B.Alice's public key for signing, Bob's private key for encryption
  3. C.Bob's private key for signing, Alice's public key for encryption
  4. D.Bob's public key for signing, Alice's private key for encryption

Answer

A

Worked solution

For a digital signature, the sender (Alice) signs the document using her private key to ensure authenticity and non-repudiation, which can be verified by anyone using Alice's public key.
For confidentiality, the sender encrypts the document using the recipient's (Bob's) public key, ensuring that only Bob (who possesses the corresponding private key) can decrypt and read it.

Marking scheme

Award 1 mark for the correct answer A. No fractional marks are given.
Question 37 · MCQ
1 marks
Which of the following statements about disk defragmentation is/are correct?

(1) It reduces the physical distance the read/write head of a Solid State Drive (SSD) needs to move, thereby extending its lifespan.
(2) It reorganizes fragmented files into contiguous sectors to improve file access speed on Hard Disk Drives (HDDs).
(3) It increases the total unused storage capacity of the disk by compressing system files.
  1. A.(1) only
  2. B.(2) only
  3. C.(1) and (3) only
  4. D.(2) and (3) only

Answer

B

Worked solution

(1) is incorrect because Solid State Drives (SSDs) do not have a physical read/write head and defragmenting them can wear out the flash memory and shorten their lifespan.
(2) is correct because Hard Disk Drives (HDDs) suffer from slow seek times when files are fragmented across non-contiguous sectors. Reorganizing them into contiguous sectors improves performance.
(3) is incorrect because defragmentation only rearranges the physical sectors of existing files to make them contiguous, but does not compress files or increase total free storage space.

Marking scheme

Award 1 mark for the correct answer B. No fractional marks are given.
Question 38 · MCQ
1 marks
In a relational database, there are two tables: `STUDENT` and `CLASS`. The primary key of `CLASS` is `ClassID`. The `STUDENT` table has a foreign key `ClassID` that references the `CLASS` table. Which of the following operations would violate referential integrity?

(1) Inserting a new record into `STUDENT` with a `ClassID` that does not exist in `CLASS`.
(2) Deleting a record from `CLASS` when there are student records referencing that `ClassID`.
(3) Updating a student's `ClassID` to `NULL`, assuming nullable constraints allow it.
  1. A.(1) only
  2. B.(1) and (2) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)

Answer

B

Worked solution

(1) Violates referential integrity because a foreign key value must exist in the referenced table's primary key column (or be NULL).
(2) Violates referential integrity because deleting a record in the parent table (`CLASS`) leaves matching records in the child table (`STUDENT`) orphaned (with no valid referenced primary key value).
(3) Does not violate referential integrity because a foreign key is allowed to be NULL (if nullable), representing that the student does not belong to any class.

Marking scheme

Award 1 mark for the correct answer B. No fractional marks are given.
Question 39 · MCQ
1 marks
Which of the following tasks should be processed using server-side scripting rather than client-side scripting?

(1) Validating that an email input field contains an '@' symbol before submission.
(2) Verifying user credentials against a secure database for user authentication.
(3) Connecting to a payment gateway API securely to process a credit card transaction.
  1. A.(1) only
  2. B.(1) and (2) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)

Answer

C

Worked solution

(1) can be easily checked on the client-side to provide instant feedback and improve user experience, reducing server load.
(2) requires accessing a database containing secure hashed passwords. This must be done on the server-side to prevent unauthorized access to the database credentials and customer records.
(3) involves handling sensitive credentials (API keys) and processing financial transactions. This must be done on the server-side to secure the API credentials and prevent tampering by the client.

Marking scheme

Award 1 mark for the correct answer C. No fractional marks are given.
Question 40 · MCQ
1 marks
Which of the following are advantages of compiled programs over interpreted programs?

(1) They generally execute faster because the source code has been translated into machine code beforehand.
(2) They are easier to debug during runtime as errors are caught and shown line by line.
(3) The source code does not need to be distributed to end-users, protecting intellectual property.
  1. A.(1) and (2) only
  2. B.(1) and (3) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)

Answer

B

Worked solution

(1) is an advantage: compiled code is translated into machine code directly executable by the CPU, making it much faster than interpreting code line-by-line during runtime.
(2) is a disadvantage: interpreted programs can be executed line-by-line, and when an error occurs, the interpreter can pinpoint the exact line, making debugging during runtime easier.
(3) is an advantage: compiled software is distributed as binary executables, meaning developers do not have to release their original source code, helping protect intellectual property.

Marking scheme

Award 1 mark for the correct answer B. No fractional marks are given.

Section B

Answer all 5 structured conventional questions.
5 Question · 50 marks
Question 1 · Structured
10 marks
(a) Character representation:

(i) Explain what "parity bit" is and how odd parity is used to detect transmission errors. (2 marks)

(ii) If the character 'A' is represented by ASCII code 65 (denary), write down its 8-bit representation using odd parity as the most significant bit (MSB). (2 marks)

(b) Sound representation:

A continuous sound wave is digitized.

(i) If the sampling rate is 16 kHz and each sample is stored in 12-bit format. Calculate the data size, in kilobytes (KB), of a 10-second mono sound recording without compression. (Show calculation steps, \(1 \text{ KB} = 1024 \text{ bytes}\)). (3 marks)

(ii) State two methods to reduce the file size of the recorded sound, other than applying file compression, and describe the trade-off of each method on sound quality. (3 marks)

Answer

Refer to solution / 參見方案

Worked solution

(a)(i) A parity bit is an extra bit added to a binary code (usually the MSB) to make the total number of 1-bits either even or odd. For odd parity, if the received byte has an even number of 1s, an error is detected.

(ii) 65 in binary (7-bit ASCII) is 1000001, which has two 1-bits (even). To make it odd, the MSB must be set to 1. Thus, the 8-bit representation is 11000001.

(b)(i) Total samples = 16,000 Hz * 10 seconds = 160,000 samples.
Total bits = 160,000 * 12 bits = 1,920,000 bits.
Total bytes = 1,920,000 / 8 = 240,000 bytes.
Size in KB = 240,000 / 1024 = 234.375 KB.

(ii) Method 1: Decrease the sampling rate (e.g., from 16 kHz to 8 kHz). Trade-off: High-frequency details are lost, resulting in a lower quality/fidelity, muffled sound.

Method 2: Decrease the bit depth / sampling resolution (e.g., from 12-bit to 8-bit). Trade-off: Reduces the dynamic range of the audio, introducing more quantization noise.

Marking scheme

(a)(i) [1 mark] Define parity bit as an extra bit added for error detection.
[1 mark] Explain that for odd parity, if the received byte has an even number of 1s, an error is detected.

(a)(ii) [1 mark] Convert 65 to 7-bit binary (1000001).
[1 mark] Correctly apply odd parity bit as MSB to get 11000001.

(b)(i) [1 mark] Correct calculation of total samples (160,000) or total bits (1,920,000).
[1 mark] Show division by 8 to convert to bytes, and 1024 to convert to KB.
[1 mark] Correct final value (234.375 KB) with units.

(b)(ii) [1 mark] Name a valid method (decrease sampling rate or decrease bit depth) and describe its trade-off.
[1 mark] Name the other valid method and describe its trade-off.
[1 mark] For accurate technical depth in both descriptions.
Question 2 · Structured
10 marks
Consider the following pseudocode algorithm designed to process an array of integers representing student test marks to find the length of the longest consecutive sequence of passing marks (>= 50).

1 Input: A, an array of N integers indexed from 1 to N
2 max_len = 0
3 current_len = 0
4 For i from 1 to N:
5 If A[i] >= 50 Then
6 current_len = current_len + 1
7 Else
8 If current_len > max_len Then
9 max_len = current_len
10 EndIf
11 current_len = 0
12 EndIf
13 EndFor
14 If current_len > max_len Then
15 [ Blank X ]
16 EndIf
17 Output max_len

(a)(i) Fill in [ Blank X ] in line 15 so that the algorithm correctly outputs the length of the longest consecutive sequence of passing marks. (1 mark)

(ii) Explain why lines 14-16 are necessary. Give a sample array of size 5 where omitting lines 14-16 would lead to an incorrect output. (2 marks)

(b) Trace the algorithm using the input array \(A = [45, 60, 75, 30, 80, 85, 90, 40]\) of size 8. Provide a trace table showing the values of variables `i`, `A[i]`, `current_len`, and `max_len` at the end of each iteration of the For loop. (4 marks)

(c) A student suggests modifying the algorithm to find the start index of the longest consecutive sequence. Describe the additional variables needed and how they should be updated in the pseudocode. (3 marks)

Answer

Refer to solution / 參見方案

Worked solution

(a)(i) max_len = current_len

(ii) Lines 14-16 are necessary because if the longest consecutive sequence of passing marks ends exactly at the last element of the array (A[N]), the For loop completes without entering the Else block (lines 7-12) where current_len would otherwise be compared and saved to max_len. Example: A = [30, 40, 60, 70, 80]. Here, the longest sequence of passing marks has length 3, but without lines 14-16, the output would be 0.

(b) Trace Table:
End of iteration i | A[i] | current_len | max_len
1 | 45 | 0 | 0
2 | 60 | 1 | 0
3 | 75 | 2 | 0
4 | 30 | 0 | 2
5 | 80 | 1 | 2
6 | 85 | 2 | 2
7 | 90 | 3 | 2
8 | 40 | 0 | 3
Final Output: 3

(c) 1. Add variables 'start_index' and 'temp_start'.
2. In the If branch (line 5), check if current_len becomes 1 (meaning a new sequence starts). If so, set temp_start = i.
3. In the lines where max_len is updated (lines 9 and 15), also set start_index = temp_start.

Marking scheme

(a)(i) [1 mark] Correctly write: max_len = current_len
(a)(ii) [1 mark] Explain that a sequence ending at A[N] won't trigger comparison in Else.
[1 mark] Provide a valid counterexample array of size 5 (ending with passing marks, showing output 0 instead of correct length).
(b) [4 marks] 0.5 marks for each correct row in the trace table.
(c) [1 mark] Propose using variables start_index and temp_start.
[1 mark] Identify that temp_start must record the index i when current_len starts a new sequence.
[1 mark] State that start_index should be updated to temp_start whenever max_len is updated.
Question 3 · Structured
10 marks
(a) Explain the main roles of the following registers during the execution of a program instruction:

(i) Program Counter (PC) (2 marks)

(ii) Memory Address Register (MAR) (2 marks)

(iii) Instruction Register (IR) / Current Instruction Register (CIR) (2 marks)

(b) A modern computer system uses multi-level cache (L1, L2, L3) between the CPU and the main memory (RAM).

(i) Explain why cache memory is necessary even though RAM size is increasing significantly. (2 marks)

(ii) Describe how the Principle of Locality (either temporal or spatial) justifies the use of cache memory. (2 marks)

Answer

Refer to solution / 參見方案

Worked solution

(a)(i) Program Counter (PC): Holds the memory address of the next instruction to be fetched from RAM. It automatically increments after an instruction is fetched, pointing to the subsequent instruction.

(ii) Memory Address Register (MAR): Holds the physical memory address (in RAM) currently being accessed for a read or write operation. It is connected directly to the address bus.

(iii) Instruction Register (IR/CIR): Temporarily stores the instruction that has just been fetched from the main memory. It holds this instruction so that the control unit can decode and execute it.

(b)(i) While RAM capacity is growing, its access speed is much slower than the CPU cycle speed. Cache memory (built from high-speed SRAM) sits between the CPU and RAM to store frequently used data and instructions, reducing the time the CPU spends waiting for RAM (wait states).

(ii) The Principle of Locality states that program executions tend to reuse data and instructions. Temporal Locality implies that if data is accessed once, it is likely to be accessed again soon (e.g., in loops). Spatial Locality implies that data near recently accessed data is likely to be accessed soon (e.g., elements in an array). Cache leverages this by keeping recently accessed data and pre-fetching adjacent memory blocks, significantly improving hit rate and performance.

Marking scheme

(a)(i) [2 marks] Explain that PC holds the address of the next instruction and increments automatically.
(a)(ii) [2 marks] Explain that MAR holds the memory address currently being read from/written to, connecting to the address bus.
(a)(iii) [2 marks] Explain that IR/CIR stores the current fetched instruction for decoding/execution by the control unit.
(b)(i) [2 marks] Explain the speed mismatch between CPU and RAM, and how cache acts as a high-speed buffer to reduce wait states.
(b)(ii) [2 marks] Define either temporal or spatial locality, and explain how keeping recently/nearby accessed data in cache increases the efficiency of memory access.
Question 4 · Structured
10 marks
A small company is setting up a local area network (LAN) for its office. The network diagram shows:

- A router connected to the Internet.

- A network switch.

- Ten desktop computers connected to the switch.

- A wireless access point (WAP) connected to the switch.

- A network printer connected to the switch.

(a) IP Addressing and Subnetting:

(i) Explain what "private IP address" means and why it cannot be used directly on the Internet. (2 marks)

(ii) State the role of Network Address Translation (NAT) in this office network. (2 marks)

(iii) The network printer is assigned a static IP address, while the office desktops are assigned dynamic IP addresses. State which protocol is responsible for automatically assigning dynamic IP addresses, and explain why the printer should have a static IP address instead. (2 marks)

(b) Wireless Security and Connection:

(i) The office implements WPA3 for its wireless network instead of WEP. Give two security reasons why WEP should not be used. (2 marks)

(ii) A visitor tries to connect a smartphone to the office Wi-Fi but fails, even though the password entered is correct. Suggest two possible reasons related to network configuration or security settings (e.g., MAC address filtering) that could cause this. (2 marks)

Answer

Refer to solution / 參見方案

Worked solution

(a)(i) A private IP address is reserved for use within local networks and is not routable on the public Internet. Internet routers discard packets containing private IP addresses to prevent conflicts and ensure security.

(ii) NAT translates private IP addresses of local devices on the LAN into a single public IP address when they access external networks. This allows multiple internal devices to share one public IP address.

(iii) DHCP (Dynamic Host Configuration Protocol) automatically assigns dynamic IP addresses. The network printer should have a static IP address so that its address remains constant, ensuring computers can reliably locate and send print jobs to it without reconfiguring connections.

(b)(i) 1. WEP uses a weak encryption algorithm (RC4 with short initialization vectors) that can be easily cracked in minutes.
2. WEP lacks strong user authentication mechanisms.

(ii) 1. MAC address filtering is enabled on the WAP/router, and the visitor's smartphone MAC address is not registered on the whitelist.
2. The DHCP IP pool in the router is exhausted (no more available IP addresses can be leased).

Marking scheme

(a)(i) [1 mark] Define private IP address as reserved for local networks.
[1 mark] Explain that they cannot be routed on the public Internet.
(a)(ii) [2 marks] Explain that NAT translates private IP addresses of LAN devices to a public IP address for Internet access (1 mark for private-to-public translation, 1 mark for allowing multiple devices to share one public IP).
(a)(iii) [1 mark] Identify DHCP as the protocol for dynamic IP assignment.
[1 mark] Explain that a static IP ensures the printer address remains constant so users can reliably find and connect to it.
(b)(i) [2 marks] 1 mark for each valid security vulnerability of WEP (e.g., weak encryption/easily cracked keys, lack of proper authentication).
(b)(ii) [2 marks] 1 mark for each valid reason (e.g., MAC filtering enabled, DHCP pool exhausted, wireless standard incompatibility).
Question 5 · Structured
10 marks
A school uses a spreadsheet to manage student participation in extra-curricular activities.

The spreadsheet contains the following columns:

- Column A: Student ID (e.g., S101)

- Column B: Name

- Column C: Class (e.g., 5A, 5B, 5C)

- Column D: Activity Code (e.g., ACT01, ACT02)

- Column E: Base Fee (in HKD)

- Column F: Subsidy Rate (e.g., 0.2 representing 20%)

- Column G: Subsidized Fee (in HKD)

- Column H: Payment Status (either "Paid" or "Pending")

(a) Formulas:

(i) Write a spreadsheet formula for cell G2 to calculate the subsidized fee of the student in row 2. (The subsidized fee is calculated as: Base Fee * (1 - Subsidy Rate).) (1 mark)

(ii) Cell I2 is used to check if a student is eligible for a special bonus. If a student is in Class "5A" and has a "Paid" status, the formula in I2 should display "Yes", otherwise it should display "No". Write down the formula for I2. (2 marks)

(iii) If the school wishes to calculate the total subsidized fees collected (i.e., only for those with payment status "Paid") across rows 2 to 100, write down a formula using a built-in spreadsheet function to achieve this. (2 marks)

(b) Data Validation and Formatting:

(i) The "Subsidy Rate" in Column F must be a decimal value between 0 and 0.5 (inclusive). Describe how to set up a data validation rule for Column F, including the validation criteria and the benefit of doing so. (3 marks)

(ii) The class teacher wants to quickly identify students who have not paid their fees. Suggest a spreadsheet feature that can automatically highlight cells in Column H with a red fill color if their value is "Pending". (2 marks)

Answer

Refer to solution / 參見方案

Worked solution

(a)(i) =E2 * (1 - F2)

(ii) =IF(AND(C2="5A", H2="Paid"), "Yes", "No")

(iii) =SUMIF(H2:H100, "Paid", G2:G100)

(b)(i) Setup: Go to Data Validation settings. Under Validation Criteria, set 'Allow' to 'Decimal', set 'Data' to 'between', and input Minimum as '0' and Maximum as '0.5'.
Benefit: It prevents users from accidentally typing invalid values (such as negative numbers or rates higher than 50%), thereby maintaining data accuracy and consistency.

(ii) Feature: Conditional Formatting.
How to apply: Select Column H (specifically cells H2:H100), choose 'Conditional Formatting', create a new rule 'Format only cells that contain', set cell value equal to 'Pending', and format the cell fill color to red.

Marking scheme

(a)(i) [1 mark] Correct formula: =E2 * (1 - F2) (accept case variations like =e2*(1-f2)).
(a)(ii) [2 marks] 1 mark for correct usage of IF and AND; 1 mark for correct conditions and string returns.
(a)(iii) [2 marks] 1 mark for correct function SUMIF and range arguments; 1 mark for criteria and sum_range.
(b)(i) [2 marks] 1 mark for choosing Decimal, 1 mark for setting between 0 and 0.5.
[1 mark] For explaining the benefit (preventing data entry errors / ensuring data consistency).
(b)(ii) [2 marks] 1 mark for naming Conditional Formatting; 1 mark for describing the setting (cell value equal to 'Pending' and selecting red fill).