In Week 4, we explored loops and how they allow programs to repeat instructions without having to write the same code multiple times.
Topics covered: • Introduction to loops and iteration • for loops • while loops • Loop conditions and termination • Incrementing and decrementing variables • Understanding infinite loops • Using loops alongside if statements • Repeating calculations and processing sequences of numbers
By the end of the session, students were able to use loops to automate repetitive tasks, process numbers and combine iteration with conditional statements.
Practical exercises included creating a Number Summary program, calculating multiplication tables and building a Number Guessing Game.