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

Sub-routines and a project

Week 5 · Unit 7.1: Block it out · 3 lessons
Answers are for parents and teachers.
1
Explain what a sub-routine is and give two reasons why programmers use them.
2
The sub-routine stars shows ‘***’. Trace the flowchart for the name Ben. Write each line of output.
Startrun: starsINPUT nameOUTPUT "Hello", namerun: starsEnd
3
A program has these steps: 1 Draw a square. 2 Move right. 3 Draw a square. 4 Move right. 5 Draw a square. Name a sub-routine and write the main program that uses it.
4
Work out the expected outcomes by hand. The pocket-money planner multiplies the weekly amount by the number of weeks and shows ‘You can buy it’ if the result is at least the price.
TestTest dataExpected outcome
1weekly = 3, weeks = 6, price = 15?
2weekly = 2, weeks = 6, price = 15?
3weekly = 5, weeks = 4, price = 20?
5
Think of a small program you could write with one input, one calculation and one choice. Write its requirements, draw its flowchart and write two test-plan rows.