Skip to the page
Year 9 · Summer 2 · Raid: Capstone

Build sprint 2

What this lesson covers

Topic 14 Programming further

KS3 Computing · Real programs keep data in lists, take text apart as strings, split work into subroutines, check their input, save to files, and get tested on purpose.

Programming Computational ThinkingCambridge Lower Secondary Computing 0860

You will learn to

  • Use the log to plan the sprint, building the must-have criteria first.
  • Join the parts of the project together and test that they work as one.
  • Demonstrate the project to another guild and record their feedback.
  • Update the log with what changed after the demo.

Success criteria

  • I can show which success criteria already work and which do not yet.
  • I can join my part to a teammate's part and test them together.
  • I can write down two stars and one wish from the other guild.

Key words

Say each word, then read what it means. Every one is in the glossary too.

List
One name holding many values in order. Also called an array.
Index
An item's position in a list, counting from 0.
Subroutine
A named block of code you can call when needed.
Function
A subroutine that returns a value.
Parameter
A placeholder in a subroutine for a value passed in.
Validation
Checking input is reasonable before using it.
Boundary data
Test data at the very edge of what's allowed.

The explanation

Read it here, or open the study page below to go one step at a time with things to try.

Plan the sprint from the log

Start with the stand-up. Read your last log entry: it says what comes next.

Sort what is left into must and nice. A must-have is in the success criteria. A nice extra is not.

★Remember

Build every must-have first. A nice extra waits until every criterion works.

Join the parts

Parts that work alone can still break when they meet. Joining them is called integration.

score = 0
name = input("What is your name? ")
score = score + ask("101", 5)
score = score + ask("1000", 8)
# … 8 more questions …
print(name, "scored", score, "out of 10")

file = open("scores.txt", "a")              # "a" adds to the end of the file
file.write(name + "," + str(score) + "\n")
file.close()
!Watch out

name + "," + score crashes, because score is a number. Turn it into text first with str(score).

After joining, run the whole program from start to end. Then test each part again.

The mid-point demo

Halfway through, show the project to another guild. It is not finished yet, and that is fine.

  1. Say the brief and the user in one sentence.
  2. Show what works, criterion by criterion.
  3. Say honestly what does not work yet.
  4. Listen. The other guild gives two stars and a wish.
★Remember

Write the feedback in your log. Decide as a guild what to change. You do not have to change everything.

e.g.Worked example

Omar's save part worked alone. After joining, the program crashes on file.write(name + "," + score + "\n"). Why, and what is the fix?

  1. Read the error: 'can only concatenate str (not "int") to str'.
  2. Concatenate means join pieces of text together. Python will not join text and a number.
  3. In Omar's own test, he typed score = "7", which is text. After joining, score comes from ask(), which returns a number.
  4. Fix: write str(score). It turns the number into text.
  5. Run the whole program again. Check that scores.txt has a new line, like Ana,7.

Study it

Open the study page and go one step at a time.

Check yourself

One question at a time. The reason shows after each answer.

Saved on this device.