Skip to content

    Loop Lagoon

    Year 5 Struktur Kawalan

    The three control structures of programming: sequence, selection (if… then… else) and repetition (loops).

    • Ages 9–11
    • 3 quests
    • Beginner → Getting stronger → Challenge

    Every program is built from three control structures. Sequence (jujukan) does steps one after another. Selection (pilihan) chooses between paths using a condition: if it is raining, then take an umbrella, else wear a cap. Repetition (ulangan) repeats steps — a fixed number of times or until a condition is met.

    What your child will learn

    • Explain sequence, selection and repetition
    • Spot each control structure in everyday situations
    • Use “if… then… else” to describe a choice
    • Use repetition to shorten an algorithm

    Why loops save time

    Instead of writing “clap” ten times, a loop says “repeat 10 times: clap”. Loops make programs shorter and easier to change.

    A vending machine uses all three: a sequence of steps, a selection (is the money enough? if yes, give the drink, if not, ask for more) and repetition (keep waiting for coins until enough are inserted).

    Example questions

    Here are a few questions like the ones in the first quest. Can you solve them?

    1. 1. Perkataan yang biasa digunakan dalam struktur pilihan ialah…

      🔀
      • “ulang”
      • “tamat”
      • “mula”
      • “jika”
      Show answer

      Answer: “jika”. Pilihan bermula dengan “jika”.

    2. 2. Perkataan yang biasa digunakan dalam struktur ulangan ialah…

      • “jika”
      • “maka”
      • “tamat”
      • “ulang”
      Show answer

      Answer: “ulang”. Ulangan menggunakan “ulang”.

    3. 3. “Jika hujan, maka bawa payung.” Syarat dalam ayat ini ialah…

      ☂️
      • payung
      • maka
      • hujan
      • bawa
      Show answer

      Answer: hujan. Syarat ialah perkara yang diperiksa.

    4. 4. Susun langkah mesin layan diri.

      • Semak wang mencukupi
      • Masukkan wang
      • Pilih minuman
      • Keluarkan minuman
      Show answer

      Answer: Pilih minuman → Masukkan wang → Semak wang mencukupi → Keluarkan minuman. Mesin menyemak wang sebelum mengeluarkan minuman.

    Tips for grown-ups

    • Play “if… then…” games: “If I clap, then you jump.”
    • Find loops in songs and dances that repeat.