Page 140 - ScienceStd4
P. 140
7. Play the game as many times as you like. How many
times did you hear the sound?
8. Click the stop button if you want to stop the program.
FOR ONLINE READING ONLY
Decision structure in programming
Sometimes it happens that, we need to do something only if
a certain condition is true. If the condition is false, we choose
not to do it. The following activities will guide you in making
decisions while preparing a computer program.
Activity 13
Using decisions in a sound program
The following steps will guide you in using decisions when
creating a sound game.
Steps
1. Click on the ‘Events’ block menu.
2. Drag and drop the ‘when clicked’ block on the script area.
3. Click on the ‘Control’ block menu.
4. Drag and drop the ‘if () then’ block on the script area.
Attach the ‘if () then’ block to the ‘when clicked’ block, as
shown in Figure 37.
133
14/01/2025 18:38
SCIENCE AND TECHNOLOGY STD 4.indd 133
SCIENCE AND TECHNOLOGY STD 4.indd 133 14/01/2025 18:38