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.
| 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 |
| # | 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. |
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.

