/en-tutor-prep-s5-ict-programming-arrays-functions-practice-1/
/en-tutor-prep-s5-ict-programming-arrays-functions-practice-1/
英文版
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 1 (Foundation, 10 Questions)

S5 ICT: Programming Arrays and Functions – Practice Paper 1 (Foundation, 10 Questions)

  • 2026-11-05

S5 ICT: Programming Arrays and Functions – Practice Paper 1 (Foundation, 10 Questions)

Paper one builds the basics: zero-based indexing, length and last index, totals and means, function arguments and return values, and linear search counts – ten items with answers and one-line notes.

Quick answer Most array marks are lost on zero-based indexing; separate index from length first, then handle search and functions.

01 Paper details (check answers afterwards)

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

02 Questions (10 items)

  1. FoundationArray A = [12, 7, 25, 3, 18]. What is the value of A[2]?
  2. FoundationWhat is the length of A, and what is the index of its last element?
  3. IntermediateWhat are the total and the mean of all elements in A?
  4. FoundationA function double(x) returns x multiplied by 2. What does double(7) return?
  5. FoundationA function add(a, b) returns a plus b. What does add(3, 4) return?
  6. IntermediateA linear search starts at A[0] and looks for 25. How many comparisons are needed, and at which index is it found?
  7. IntermediateAfter swapping A[1] with A[3], what is the value of A[1]?
  8. ChallengeWhat is the value of the expression 25 % 4?
  9. ChallengeA program reads A[5] on an array of length 5. What happens?
  10. Error redoA total loop starts sum at 1 instead of 0. Summing the five elements of A, how far off is the result?

03 Answers and one-line notes

# Answer One-line note
1 25 Indexing starts at 0, so A[0]=12, A[1]=7 and A[2]=25.
2 Length 5; last index 4. An array of length 5 has indices 0 to 4, so the last index is the length minus 1.
3 Total 65; mean 13.0. 12+7+25+3+18 = 65, and 65 divided by 5 gives 13.0.
4 14 The argument 7 replaces x, so the function returns 7 times 2, which is 14.
5 7 The arguments go in by position, a=3 and b=4, so the result is 7.
6 Three comparisons; index 2. It compares A[0]=12, A[1]=7 then A[2]=25, so the third comparison succeeds.
7 3 A[1] held 7 and A[3] held 3, so after the swap A[1] holds 3.
8 1 25 divided by 4 gives quotient 6 and remainder 1, and the % operator returns the remainder.
9 The index is out of range and the program raises an error. Valid indices are 0 to 4, so A[5] does not exist and most languages raise an index error.
10 One too many, giving 66. Starting at 1 adds a spurious 1, so the total becomes 66 instead of 65.

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 →