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

Words before code

Week 1 · 1.1 Pseudocode · 3 lessons
Answers are for parents and teachers.
1
Write these two lines in another valid pseudocode style, and then in Python: total ← price * 3 and OUTPUT "Total: ", total.
2
Follow the algorithm for the inputs 4, 10 and 25. What is output each time?
Pseudocode
1INPUT n
2IF n > 10 THEN
3    n ← 10
4ENDIF
5OUTPUT n * 3
3
This algorithm should show Freezing for 0 degrees or colder. Edit it to do that. Then add a new task: if the temperature is below −10 it must also show Stay in. Write the edited algorithm.
Pseudocode
1INPUT temp
2IF temp < 0 THEN
3    OUTPUT "Freezing"
4ELSE
5    OUTPUT "Not freezing"
6ENDIF
4
This algorithm should work out the average of three marks. The user types 6, 9 and 12. Find the error, say what is output, and correct it.
Pseudocode
1INPUT a
2INPUT b
3INPUT c
4average ← a + b + c / 3
5OUTPUT average
5
Why do designers write pseudocode before they write a program in Python?