AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Build it yourself

Week 4 · 1.3 Creating algorithms · 3 lessons
Answers are for parents and teachers.
1
Plan this problem in three steps and write the pseudocode. A tap sign: the user types the water temperature. Over 40 it shows Too hot, otherwise Safe to use.
2
Follow the algorithm for 0, 1, 3, 4, 5 and 7 coins. What is output each time?
Pseudocode
1INPUT coins
2IF coins >= 5 THEN
3    OUTPUT "Large"
4ELSEIF coins >= 3 THEN
5    OUTPUT "Medium"
6ELSEIF coins >= 1 THEN
7    OUTPUT "Small"
8ELSE
9    OUTPUT "No snack"
10ENDIF
3
Follow the flowchart when the user types 4, 10 and 6. What is output?
Starttotal ← 0n ← 1n <= 3?yesINPUT xtotal ← total + xn ← n + 1noOUTPUT totalEnd
4
Write pseudocode. The user types the ages of 5 players. Output how many of them are 12 or older.
5
Why must total ← 0 be written before the loop?