DSE ICT | Programming Tutorial Plan (for tutors) | Array indexing, function reuse, linear and binary search, three-step debugging
- 2026-11-02
Students can write a for loop, yet when asked for the third element of an array they start counting at one. This lesson puts 5 marks into one dataset and ties indexing, functions and comparison counts to the same countable line.
01 Prerequisites (3-minute check)
If any of these fails, fix it before the lesson starts.
| Skill | Quick check | Pass mark |
|---|---|---|
| Variables | How many values one variable can hold at a time | One, unless an array is used |
| Loops | How many times for i from 0 to 4 runs | Five times |
| Comparison | The difference between greater than and greater than or equal | Whether equality is included |
02 Lesson flow (60 minutes)
| Time | Stage | Tutor does | Student does |
|---|---|---|---|
| 0-5 min | Opening question | Write 42 55 38 61 49 and ask which is the fourth number | Answer aloud and explain the counting |
| 5-15 min | Prerequisite check | Hand out three written checks (variables, loop count, comparison) | Written answers, marked on the spot |
| 15-37 min | Three scenes | Teach arrays and indexing, functions and parameters, search and debugging | After each scene, one sentence on where the number came from |
| 37-49 min | Worked questions | Model four questions, each as data, steps, answer | Copy, then rewrite from memory |
| 49-55 min | Independent practice | Circulate, only asking whether the question is about index or count | Do three questions and self-mark |
| 55-60 min | Exit check | Collect answers and count errors live | Written, no talking |
03 Teaching script (read it out)
Scene 1: Scene 1: Arrays, indexing and range errors
If a program reads index 5 of a five-element array, what happens and why?
Scene 2: Scene 2: Functions, parameters and reuse
Why is a function safer than copy and paste when the formula changes?
Scene 3: Scene 3: Search counts and three-step debugging
Binary search is so much faster, so should it always be used?
04 Question types and worked steps
| Type | Example | Steps | Answer |
|---|---|---|---|
| Index tracing | marks is 42, 55, 38, 61, 49. What is marks[3]? | 1 count from zero; 2 reach the fourth element; 3 state the value; 4 note it is not counted from one. | Example: 61 at index 3. |
| Sum and mean | For the same array, find the sum and the mean. | 1 accumulate in a loop; 2 divide by the element count; 3 keep one decimal place; 4 check the mean sits inside the range. | Example: sum 245, mean 49.0. |
| Comparison count | On 5 sorted elements, what are the worst-case comparison counts? | 1 linear equals the element count; 2 binary is the ceiling of log base two; 3 state the sorted precondition; 4 label the unit as comparisons. | Example: linear 5, binary 3. |
| Debugging | A maximum program returns 49. Find the fault. | 1 reproduce and record the input; 2 print intermediates; 3 name the wrong comparison; 4 change one line and rerun. | Example: the test used less than, it should be greater than. |
05 Independent practice (3 questions)
| Question | Answer | What to watch |
|---|---|---|
| Write the index expression for the last element of the array. | marks[4], which is length minus one. | Check for marks[5]. |
| Rewrite three copies of a mean calculation as one function, naming the parameter and the return value. | The parameter is the array, the return value is the mean, and the main program calls it once. | Check whether printing was moved inside the function. |
| How many comparisons does a linear search need to find 61 among 5 elements? | 4, because 61 sits at index 3, the 4th item counted from the front. | Check for an answer of one. |
06 Common mistakes and what to say
| Mistake | Student writes | Say this |
|---|---|---|
| Counting from one | Answering that marks[4] is the fifth element. | Indexing starts at zero, so the fifth element is index 4. Using 5 is out of range. |
| Ignoring the comparison count | Saying binary search just finds the value, so the count does not matter. | The question asks for comparisons. On 5 elements the binary worst case is 3, because each step halves the list. |
| Binary search on unsorted data | Applying binary search before sorting. | Binary search assumes sorted data. Sort first, or values will be missed. |
| Side effects in a function | A function that computes, prints and changes a global at once. | One function, one job, otherwise it cannot be tested. Leave printing to the caller. |
07 Homework (paper, section and question numbers)
- Secondary ICT index: finish the three questions on this page, then compare with the network security and encryption chapter — Practice 1-3 on this page
08 Exit check (last 5 minutes)
| Question | Answer | Decision |
|---|---|---|
| What is the largest index of a five-element array? | 4 | Cannot answer = reteach scene 1 |
| What are the two core parts of a function? | Parameters and a return value | Cannot answer = reteach scene 2 |
| What precondition does binary search need? | Sorted data | Cannot answer = reteach scene 3 |
09 Tutor FAQ
Which year is this for?
Mainly the S5 ICT programming unit; a useful extension after loops in S4.
Does a particular language have to be used?
The ideas are language neutral; examples use pseudocode and work with Python or Java.
Is binary search essential?
DSE compares the efficiency of linear and binary search, so both counts must be stated.
Find a tutor — freeTutor Registration →
A TutorZone lesson-prep guide. Written by the TutorZone team; questions and lesson flow are original and are not taken from any school or publisher material.


