/en-s5-ict-programming-algorithms-systems-practice-paper/
/en-s5-ict-programming-algorithms-systems-practice-paper/
英文版
3
General Inquiry: info@TutorZone.com.hk
Office Hours: Monday to Saturday - 9:00 AM to 6:00 PM
WhatsApp Monday to Sunday - 24 hours
Hotline: +852 6828 1809
Instant Support: +852 9061 3106

S5 ICT Paper: Programming, Algorithms and System Development (100 marks)

S5 ICT Paper: Programming, Algorithms and System Development (100 marks)

  • 2026-11-11

S5 ICT – programming and algorithms

S5 ICT paper: six questions on algorithms, code tracing, array searching and sorting, the system development cycle, testing and data representation, with answers.

Paper details S5 ICT practice paper with six questions on algorithm step counting, flowchart tracing, code output, array searching and sorting, the system development life cycle, testing methods and data representation with file size and transmission calculations, with full answers and marking notes.

Section A: Algorithms and Flowcharts (18 marks)

The following questions are about counting algorithm steps and tracing a flowchart.

# Question Answer and marking notes
1 A flowchart sets total to 0 and i to 1, then while i is not greater than 10 it adds i to total and increases i by 1. Find the final value of total and the number of loop iterations. Answer: total = 1 + 2 + … + 10 = 55, and the loop runs 10 times. (Marking: 2 marks for the summation, 1 mark for the total, 1 mark for the count.)
2 A program sets n to 100, then while n is greater than 1 it repeatedly replaces n by the integer part of n divided by 2. Find the number of executions and the final value of n. Answer: n becomes 50, 25, 12, 6, 3 then 1, so the step runs 6 times and the final value of n is 1. (Marking: 3 marks for the updates, 1 mark for the count, 1 mark for the final value.)
3 A bubble sort is used on 6 data items. Find the number of comparisons in the first pass. Answer: the first pass compares adjacent pairs from the first up to the 5th, that is 5 comparisons. (Marking: 2 marks for the explanation, 2 marks for the answer.)
4 Algorithm A takes n steps and algorithm B takes n² steps. When n = 200, find both step counts and how many times slower B is. Answer: A takes 200 steps and B takes 40000 steps, so B is 200 times slower. (Marking: 2 marks for each step count, 1 mark for the ratio.)

Section B: Code Tracing and Computation (20 marks)

Given the list nums = [4, 7, 2, 9, 5], a program sets total to 0, checks each element in turn and adds it to total when the element is odd.

# Question Answer and marking notes
5 Find the final value of total and how many elements were added to it. Answer: the odd elements are 7, 9 and 5, so total = 21 from 3 elements. (Marking: 3 marks for the odd elements, 2 marks for the total.)
6 If the condition is changed so that only even elements are added, find the final value of total. Answer: the even elements are 4 and 2, so total = 6. (Marking: 3 marks for the even elements, 2 marks for the total.)
7 Another program sets k to 1 and then multiplies k by every integer from 1 to 4. Find the final value of k. Answer: k = 1 × 1 × 2 × 3 × 4 = 24. (Marking: 3 marks for the product, 2 marks for the answer.)
8 Find the mean of the elements in nums, correct to one decimal place. Answer: the sum is 27, so the mean is 27 ÷ 5 = 5.4. (Marking: 2 marks for the sum, 1 mark for dividing by the number of elements, 2 marks for rounding.)

Section C: Arrays, Searching and Sorting (18 marks)

A sorted array is given as arr = [11, 23, 35, 47, 59, 71, 83].

# Question Answer and marking notes
9 Using linear search to find 83 in arr, how many comparisons are needed? Answer: 83 is in the last position, so 7 comparisons are needed. (Marking: 2 marks for the method, 3 marks for the answer.)
10 Using binary search to find 83 instead, list the middle elements compared and find the number of comparisons. Answer: the middle elements compared are 47, 71 then 83, so 3 comparisons are made. (Marking: 1 mark for each middle element, 1 mark for the count.)
11 How many elements can a 3 by 4 two-dimensional array hold, and what is the position of arr[2][1] in row-major order? Answer: it holds 12 elements; before arr[2][1] there are 2 × 4 + 1 = 9 elements, so it is the 10th. (Marking: 2 marks for the total, 2 marks for the position working, 1 mark for the answer.)
12 Sorting 6 data items by bubble sort, what is the total number of comparisons in the worst case? Answer: the passes compare 5 down to 1 pairs, giving 15 comparisons in total. (Marking: 2 marks for the series, 2 marks for the answer.)

Section D: System Development Life Cycle (14 marks)

A school plans to build an attendance system using the 5 stages of the system development life cycle.

# Question Answer and marking notes
13 List the names of the 5 stages of the system development life cycle. Answer: feasibility study, system analysis, system design, system implementation and system maintenance. (Marking: 1 mark per stage, up to 4.)
14 Compare waterfall development with agile development in handling changing requirements. Answer: waterfall proceeds stage by stage, so changes are costly once requirements are fixed; agile delivers in short repeated cycles and absorbs changes continuously. (Marking: 2 marks for each approach.)
15 Which two documents or diagrams are usually produced during system analysis? Answer: a requirements specification and a data flow diagram. (Marking: 1.5 marks each.)
16 State two methods of system changeover. Answer: direct changeover and parallel changeover (phased or pilot changeover also accepted). (Marking: 1.5 marks each.)

Section E: Testing and Debugging (16 marks)

A login form requires a password of length from 8 to 16 characters.

# Question Answer and marking notes
17 Using equivalence partitioning, state the 4 equivalence classes for the password length input. Answer: valid (8 to 16 characters), invalid (fewer than 8), invalid (more than 16) and invalid (empty input). (Marking: 1 mark per class.)
18 Using boundary value analysis, state the 4 length values that should be tested. Answer: the four lengths 7, 8, 16 and 17. (Marking: 1 mark per value.)
19 Explain the difference between black box testing and white box testing. Answer: black box testing looks only at inputs and outputs without regard to internal structure; white box testing designs tests from the code structure and checks each path. (Marking: 2 marks each.)
20 Give one example each of a syntax error and a logic error, and state which one a compiler or interpreter can detect. Answer: a missing colon or an unmatched bracket is a syntax error and is detected by the compiler or interpreter; using the wrong divisor for a mean is a logic error, which still runs but gives wrong results and must be found by testing. (Marking: 1.5 marks per example, 1 mark for the conclusion.)

Section F: Data Representation, Files and Transmission (14 marks)

An uncompressed bitmap has a resolution of 1024 by 768 and uses 3 bytes per pixel for colour.

# Question Answer and marking notes
21 Find the file size of the image in bytes, KiB and MiB. Answer: 1024 × 768 × 3 = 2359296 bytes = 2304 KiB = 2.25 MiB. (Marking: 2 marks for the multiplication, 1 mark for bytes, 0.5 mark per other unit.)
22 If 24-bit colour depth is used per pixel instead, how many colours can be represented? Answer: 2 to the power 24 = 16777216 colours. (Marking: 2 marks for the expression, 2 marks for the value.)
23 A document of 8 pages holds about 2500 ASCII characters per page. Find its size in KiB. Answer: 8 × 2500 = 20000 bytes, about 19.5 KiB. (Marking: 2 marks for the byte count, 1 mark for the conversion.)
24 Sending the image over a 10 Mbps network, ignoring overhead, find the time needed in seconds to three decimal places. Answer: 18874368 bits ÷ 10 000 000 = 1.887 seconds. (Marking: 1 mark for the bit conversion, 1 mark for dividing by the rate, 1 mark for the answer.)

Find a tutor — freeTutor Registration →

A TutorZone practice paper; original questions and passages, not publisher material.

Join as a tutor or coach — academic, music, sports, arts, STEM. Free to register. See how it works →