Build and judge programs
Answers are for parents and teachers.
1
Part A is clap, clap, stamp. Part B is stamp, stamp, clap. Write the song A, B, A, A, B as calls. How many claps are in the whole song?
Calls: A, B, A, A, B. A has 2 claps and is called 3 times, so 6 claps. B has 1 clap and is called 2 times, so 2 claps. Altogether 6 + 2 = 8 claps.
2
Write the algorithm for laying the table for four people using two sub-routines, ‘lay one place’ (put a plate, put a fork, put a cup) and ‘lay the table’, which calls lay one place for each seat. How many cups are put out?
lay one place: put a plate, put a fork, put a cup. lay the table: lay one place, move to the next seat, and repeat for four seats. 4 cups are put out, one for each place.
3
Trace the program. What is the x position of the sprite at the end?
step adds 10, and stride runs step 3 times, so stride adds 30. The main script calls stride twice, so it adds 60. -20 + 60 = 40. The sprite ends at x = 40.
4
A school wants a program to practise times tables. Write one question for each of the four criteria, and say which one you think matters most and why.
For example: Does it ask all the tables? (function) Is it free or cheap? (cost) Can a pupil start without lessons? (training and support) Does it run on our tablets? (technical requirements). The most important is usually function, because the program must do the job.
5
(if you have a computer or tablet) In Scratch, make draw spoke and draw wheel from this week and run them. Change the number of spokes and the turn so that the wheel is still complete.
With 6 spokes the turn is 60. With 10 spokes the turn is 36. The number of spokes times the turn must be 360.