Cover lesson · IT · Year 7 · Beginner
DCF: Data and computational thinking → Problem-solving and modelling
Name: Class: Date:
What this practises: following an algorithm step by step (tracing), choosing test data, and finding bugs, all on paper. The money work (pence and pounds, change, a weekly budget) is real numeracy and is marked from the sheet.
Print: this sheet, one per pupil, and the stimulus sheet “Siop Fach: the tuck shop till”, one between two. No computers are needed. Calculators are not needed; all the sums are small.
Run: 5 min read the stimulus sheet aloud and do Step 1 · 15 min Step 2 · 7 min Step 3 · 10 min Step 4 · 8 min Step 5 · 10 min Step 6. Total 55 minutes.
Collect: this sheet. Quick checks: Order A change 70p (50p, 20p); Order B pays £2.30, change £2.70 (£2, 50p, 20p); Order C first shows “Not enough money”, then change 5p. The two bugs in Step 5 are in box 6 and box 9.
The IT department has written a till program for Siop Fach, the school tuck shop. Before it goes live, you are the tester. You will follow the flowchart exactly as a computer would, record what happens to each value, design tests that could catch mistakes, find the bugs in a second version, and then use the prices to plan a week of break-time snacks on a budget.
Look at the flowchart on the stimulus sheet. Write the number of one box of each type.
| Type of box | Box number | What happens in that box |
|---|---|---|
| Input (data goes in) | ||
| Process (the till works something out) | ||
| Decision (Yes or No question) | ||
| Output (data comes out) |
Follow the flowchart for each order. Every time a value changes, write the new value on the next row of the trace table. Work in pence. The first rows of Order A are done for you.
Order A (Rhys): toast, bottle of water. He pays with a £2 coin.
| Box | items | total | paid | change | Output |
|---|---|---|---|---|---|
| 2 | 0 | 0 | |||
| 4 | 1 | 60 | |||
Order B (Ffion): flapjack, fruit juice, fruit pot. She pays with a £5 note.
| Box | items | total | paid | change | Output |
|---|---|---|---|---|---|
Order C (Osian): cheese roll, fruit juice. He hands over £2. When the till asks again, he hands over £2.10 instead.
| Box | items | total | paid | change | Output |
|---|---|---|---|---|---|
Use the method in section 4 of the stimulus sheet. Write the coins the till gives and how many coins that is.
| Change | Coins given | Number of coins |
|---|---|---|
| Order B: £2.70 | ||
| 38p | ||
| 95p | ||
| £3.65 |
Why does the till start with the biggest coin and not the smallest?
Good testers choose data that could catch a mistake, especially at the edges of a rule (exactly 3 items, or paying the exact amount). Work out what a correct till should output for each test.
| Test | What it checks | Order and money paid | Expected output (show your working) |
|---|---|---|---|
| 1 | 2 items: no discount | Toast, water. Pays 200p. | 130 total, change 70p (50p, 20p) |
| 2 | Exactly 3 items: discount | Toast, water, fruit pot. Pays 200p. | |
| 3 | Pays the exact amount | Flapjack. Pays 90p. | |
| 4 | Not enough money | Cheese roll. Pays 100p. | |
| 5 | More than 3 items | Toast, toast, water, juice. Pays 300p. |
The programmer made a Version 2 of the till. They ran your five tests on it and got these outputs.
| Test | Version 2 output | Pass or fail? | |
|---|---|---|---|
| 1 | Change 70p (50p, 20p) | ||
| 2 | “Not enough money” | ||
| 3 | “Not enough money” | ||
| 4 | “Not enough money” | ||
| 5 | Change 50p (50p) |
(a) For each failed test, which box do you think is wrong? Write what that box probably says in Version 2, and what it should say.
(b) Test 5 passed, even though Version 2 has a bug in the discount box. Explain why. What does this tell you about choosing test data?
Show your working in pence, then give each answer in pounds and pence.
(a) Which 3 items make the cheapest order? How much does that order cost after the discount?
(b) Gwen has £10 for the week. If she buys that cheapest order every day from Monday to Friday, what does the week cost, and how much is left?
(c) Ffion buys a flapjack and a fruit juice every day (2 items, no discount). What does that cost for 5 days? She thinks adding toast each day will only cost her 35p more a day, because of the discount. Is she right? Can she do this every day on £10?
(d) Plan your own week at Siop Fach on a £10 budget. You must buy at least 2 items every day.
| Day | Items | Cost (pence) | Discount? |
|---|---|---|---|
| Monday | |||
| Tuesday | |||
| Wednesday | |||
| Thursday | |||
| Friday | |||
| Week total | Left from £10: |