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

Which path comes first?

Week 3 · 1.2 Selection in pseudocode · 3 lessons
Answers are for parents and teachers.
1
Follow the algorithm for the inputs 3, 4 and 12. What is shown each time?
Pseudocode
1INPUT n
2IF n > 10 THEN
3    OUTPUT "Stay out"
4ELSEIF n > 4 THEN
5    OUTPUT "Paddle only"
6ELSE
7    OUTPUT "Safe to splash"
8ENDIF
2
Write pseudocode: the user types the number of tickets sold. Below 50 shows Slow, below 200 shows Steady, below 500 shows Busy and anything else shows Sold out soon.
3
A programmer wrote IF mark >= 40 ... ELSEIF mark >= 70 ... ELSE .... Explain what is wrong with the order and how to fix it.
4
List the boundary values you would test for the fare program in lesson 2 (ranges below 5, up to 17, up to 64, and over 64) and say why.
5
In your own words, say what a case statement does and why Python programmers use if and elif instead.