/en-tutor-prep-s5-ict-programming-arrays-functions-practice-4/
/en-tutor-prep-s5-ict-programming-arrays-functions-practice-4/
英文版
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: Programming Arrays and Functions – Practice Paper 4 (Error Review, 10 Questions)

S5 ICT: Programming Arrays and Functions – Practice Paper 4 (Error Review, 10 Questions)

  • 2026-11-05

S5 ICT: Programming Arrays and Functions – Practice Paper 4 (Error Review, 10 Questions)

Paper four reviews the usual mistakes: mixing index with length, out-of-range reads, forgetting to divide for a mean, remainder versus exact division, reversed arguments, a loop that skips the first element, and binary search on unsorted data – ten items with answers.

Quick answer Most lost marks come from treating an index as a length or a print as a return value; settle those two and the rest follows.

01 Paper details (check answers afterwards)

Item Detail
Questions 10 questions
Suggested time 25 minutes
Difficulty mix Error redo 4 · Foundation 2 · Intermediate 2 · Challenge 2
Chapter Chapter: S5 ICT | Programming: Arrays and Functions
Level Error review

02 Questions (10 items)

  1. Error redoArray C has 7 elements and a student writes C[7] to reach the last element. What is wrong, and which index should be used?
  2. Error redoA linear search starts at C[0] and looks for 22 in C. How many comparisons are needed in total?
  3. FoundationThe total of C is 133 and a student writes the mean as 133. What is the correct mean?
  4. FoundationWhat is the value of 133 % 7, and what does it say about 133 and 7?
  5. IntermediateA function sub(a, b) returns a minus b. A student wants 9 minus 5 but writes sub(5, 9). How far is the result from the correct value?
  6. IntermediateTo sum C a loop should run FOR i = 0 TO 6, but a student writes FOR i = 1 TO 6. What total results?
  7. Error redoA student runs a binary search for 22 directly on C. Is that correct, and why?
  8. ChallengeSorting C gives D = [5, 9, 13, 16, 22, 28, 40]. A binary search looks for 22 in D. How many comparisons does it make?
  9. ChallengeHow many swaps are needed to reverse an array of length 7?
  10. Error redoA function prints its result with print instead of returning a value. What does the caller receive?

03 Answers and one-line notes

# Answer One-line note
1 It is an error: the index is out of range; use C[6], whose value is 22. Valid indices run from 0 to 6, so the last index is the number of elements minus 1.
2 Seven. 22 sits in the last position, so C[0] through C[6] are compared, seven in total.
3 19.0. A mean divides the total by the number of elements, so 133 divided by 7 gives 19.0.
4 0, so 133 is exactly divisible by 7. 133 equals 7 times 19 with remainder 0, so the division is exact.
5 It gives -4 instead of 4, a difference of 8. Arguments go in by position, so reversing the order returns the opposite value.
6 117. C[0]=16 is skipped, so the total drops from 133 to 117.
7 No, because C is not sorted. Binary search discards half the data using the middle value, so unsorted data can be missed.
8 Three. The middle indices are 3 (16), 5 (28) and 4 (22).
9 Three. Pairs are swapped from both ends; 7 divided by 2 rounded down is 3, and the middle element stays.
10 A null value, which cannot be used in further calculations. print only writes to the screen and hands nothing back to the caller.

04 What to do after marking

  • After marking, redo only the wrong items and write down which step went wrong (formula, unit, or misread number).
  • Repeat the same item two days later; move to the next paper only when both attempts are correct.
  • Parents only need the answer and note columns; there is no need to explain every item.

Find a tutor freeTutor Registration →

Questions and answers are written originally by the TutorZone team and are not taken from any school, publisher or examination authority paper. Every value is checked by computer.

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