Computers make choices using “if” rules: if something is true, then do this. Year 1 coders follow simple if–then rules from everyday life and see how robots use them to decide what to do.
Apa yang akan dipelajari anak anda
- Follow simple if–then rules
- Know that the action only happens when the condition is true
- Begin to use if–then–else to choose between two actions
If this, then that
We use if–then rules all the time: if it is raining, then take an umbrella. A computer checks the condition — is it raining? — and only runs the action if the answer is yes. “Else” says what to do when the answer is no.
Contoh soalan
Berikut ialah beberapa soalan seperti dalam misi pertama. Bolehkah anda menjawabnya?
1. Rule: if the plant is dry, water it. The soil is wet. What should you do?
- Pull it up
- Paint it
- Water it
- Leave it — it doesn’t need water
Tunjuk jawapan
Jawapan: Leave it — it doesn’t need water. The soil isn’t dry, so the rule doesn’t run.
2. Rule: if you are cold, put on a jumper. You are warm. What do you do?
- Put on two jumpers
- Open the freezer
- Nothing — you don’t need a jumper
- Put on a jumper
Tunjuk jawapan
Jawapan: Nothing — you don’t need a jumper. You aren’t cold, so the rule doesn’t run.
3. If it is raining, you should…
🌧️- take off your shoes
- put on sun cream
- wear a raincoat
- wear sunglasses
Tunjuk jawapan
Jawapan: wear a raincoat. The condition “it is raining” is true, so you do the “then” part: wear a raincoat.
Tip untuk orang dewasa
- Play “Simon says” — it is an if–then game!
- Make up if–then rules for the day: if it is sunny, we go to the park.