Page 29 - Touchcode_C7_Flipbook
P. 29
Experiential Learning
Coding Task 03
Distributing birthday sweets
Algorithm:
Step 1: Take the chocolates out from your bag
Step 2: Gives one chocolate to a student
Step 3: Moves to the next student
Step 4: Repeat the same steps till the sweets are distributed within all the students.
This is an example of iteration.
In this, the process (you take the chocolates out from your bag, give one chocolate to
a student, and moves to the next student) is repeated until all the students in the class
were given chocolates.
Flowchart:
Start
Take one chocolate from the bag
Give chocolate to the student
Yes
Are there any more students
left in the class who did not get
chocolates?
No
Stop
Well done, you have learned to write an algorithm and draw a flowchart
of distributing birthday sweets!
Sequencing with Block Coding 27

