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)
- 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?
- Error redoA linear search starts at C[0] and looks for 22 in C. How many comparisons are needed in total?
- FoundationThe total of C is 133 and a student writes the mean as 133. What is the correct mean?
- FoundationWhat is the value of 133 % 7, and what does it say about 133 and 7?
- 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?
- IntermediateTo sum C a loop should run FOR i = 0 TO 6, but a student writes FOR i = 1 TO 6. What total results?
- Error redoA student runs a binary search for 22 directly on C. Is that correct, and why?
- 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?
- ChallengeHow many swaps are needed to reverse an array of length 7?
- 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.


