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?
- A.150
- B.-106
- C.-105
- D.-92
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.
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?
- A.3
- B.9
- C.15
- D.24
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).
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.
- A.(1) and (2) only
- B.(1) and (3) only
- C.(2) and (3) only
- D.(1), (2) and (3)
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).
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?
- A.192.168.10.28
- B.192.168.10.31
- C.192.168.10.42
- D.192.168.10.48
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).
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.
- A.(1) and (2) only
- B.(1) and (3) only
- C.(2) and (3) only
- D.(1), (2) and (3)
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).
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?
- A.=$A$1 + B1
- B.=$C$3 + D3
- C.=$A$1 + D3
- D.=$A$1 + C3
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).
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?
- A.Alice encrypts with Alice's public key; Bob decrypts with Bob's private key.
- B.Alice encrypts with Bob's public key; Bob decrypts with Bob's private key.
- C.Alice encrypts with Bob's private key; Bob decrypts with Alice's public key.
- D.Alice encrypts with Alice's private key; Bob decrypts with Alice's public key.
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).
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.
- A.(1) and (2) only
- B.(1) and (3) only
- C.(2) and (3) only
- D.(1), (2) and (3)
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).
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?
- A.Syntax error
- B.Runtime error
- C.Logical error
- D.Compilation error
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).
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}\))
- A.5.3 MB
- B.10.6 MB
- C.21.2 MB
- D.42.3 MB
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).
An 8-bit register represents signed integers using two's complement representation. What is the decimal value represented by the binary string \(11001011_2\)?
- A.-53
- B.-52
- C.-75
- D.203
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.
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.
- A.(1) and (2) only
- B.(1) and (3) only
- C.(2) and (3) only
- D.(1), (2) and (3)
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.
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?
- A.\(192.168.10.30\)
- B.\(192.168.10.50\)
- C.\(192.168.10.65\)
- D.\(192.168.10.128\)
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.
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.)
- A.9
- B.15
- C.21
- D.24
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.
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?
- A.`=$A4 + D$1`
- B.`=$C4 + D$1`
- C.`=$A4 + B$1`
- D.`=$A2 + D$3`
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.
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?
- A.Inserting a new record into `STUDENT` with a `ClassID` that does not exist in the `CLASS` table.
- B.Deleting a record from `STUDENT`.
- C.Inserting a new record into `CLASS` with a new `ClassID`.
- D.Updating the `Teacher` field of an existing record in the `CLASS` table.
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.
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?
- A.Encrypt the message with Bob's public key, and sign with Alice's private key.
- B.Encrypt the message with Alice's public key, and sign with Bob's private key.
- C.Encrypt the message with Bob's private key, and sign with Alice's public key.
- D.Encrypt the message with Alice's private key, and sign with Bob's public key.
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.
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?
- A.\(-1, 0, 49, 50, 100, 101\)
- B.\(0, 50, 100\)
- C.\(-10, 50, 150\)
- D.\(0, 1, 49, 50, 51, 99, 100\)
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.
Which of the following is an example of a data verification method rather than a data validation method?
- A.Double entry
- B.Range check
- C.Format check
- D.Check digit
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.
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.
- A.(1) and (2) only
- B.(1) and (3) only
- C.(2) and (3) only
- D.(1), (2) and (3)
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.
In an 8-bit two's complement binary system, what is the representation of the decimal value \(-43\)?
- A.11010101
- B.10101011
- C.11010100
- D.00101011
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.
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.
- A.(1) only
- B.(2) only
- C.(1) and (3) only
- D.(2) and (3) only
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.
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?
- A.X = 0, result = 3
- B.X = 2, result = 3
- C.X = 2, result = 4
- D.X = 14, result = 3
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.
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)?
- A.127.0.0.1
- B.192.168.1.0
- C.172.16.10.25
- D.224.0.0.1
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.
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?
- A.32
- B.35
- C.42
- D.15
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.
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?
- A.\(\frac{44100 \times 16 \times 2 \times 300}{8 \times 1024 \times 1024}\)
- B.\(\frac{44100 \times 16 \times 300}{8 \times 1024 \times 1024}\)
- C.\(\frac{44100 \times 16 \times 2 \times 5}{8 \times 1024 \times 1024}\)
- D.\(\frac{44100 \times 16 \times 2 \times 300}{1024 \times 1024}\)
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.
During the fetch stage of the machine cycle, which register stores the address of the next instruction to be executed?
- A.Program Counter (PC)
- B.Instruction Register (IR)
- C.Memory Address Register (MAR)
- D.Accumulator (ACC)
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.
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?
- A.10
- B.500
- C.1,000
- D.1,024
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.
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?
- A.DNS
- B.DHCP
- C.HTTP
- D.ARP
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.
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?
- A.(1) Data validation; (2) Data validation
- B.(1) Data validation; (2) Data verification
- C.(1) Data verification; (2) Data validation
- D.(1) Data verification; (2) Data verification
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.
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?
- A.-51
- B.-53
- C.51
- D.-17
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.
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?
- A.20
- B.24
- C.26
- D.30
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.
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?
- A.0.625
- B.0.8
- C.1.25
- D.1.6
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.
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?
- A.Subnet Mask: 255.255.255.192, Usable Hosts: 62
- B.Subnet Mask: 255.255.255.192, Usable Hosts: 64
- C.Subnet Mask: 255.255.255.224, Usable Hosts: 30
- D.Subnet Mask: 255.255.255.224, Usable Hosts: 32
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.
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?
- A.=$B3+F$2
- B.=$E3+F$2
- C.=$B3+C$2
- D.=$E1+C$2
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.
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?
- A.Alice's private key for signing, Bob's public key for encryption
- B.Alice's public key for signing, Bob's private key for encryption
- C.Bob's private key for signing, Alice's public key for encryption
- D.Bob's public key for signing, Alice's private key for encryption
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.
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.
- A.(1) only
- B.(2) only
- C.(1) and (3) only
- D.(2) and (3) only
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.
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.
- A.(1) only
- B.(1) and (2) only
- C.(2) and (3) only
- D.(1), (2) and (3)
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.
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.
- A.(1) only
- B.(1) and (2) only
- C.(2) and (3) only
- D.(1), (2) and (3)
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.
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.
- A.(1) and (2) only
- B.(1) and (3) only
- C.(2) and (3) only
- D.(1), (2) and (3)
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.