What you'll build
A school wants a program to handle a student's results. You won't write any code — you'll plan the functions the program needs, describing each one in plain words: its name, what it needs, its job, and whether it hands back an answer.
Requirements
The must-do parts. If any are missing, we'll ask you to take another pass.
- Read the school scenario under The scenario below — twice. Picture a real student's row of marks before you write anything down.
- Find the separate jobs hiding in the story. Some are calculations, some are decisions, and one or two simply show something on screen. Each separate job is a candidate for its own function — aim for at least four, and keep each one to a single job.
- For each function you find, answer the four questions: (1) What is its name? (2) What information does it need? (3) What job does it do? (4) Does it return an answer — and if so, what?
- Write in plain words — no Python needed. A good function name is a verb (see the worked example below for the shape of an answer). Rule of thumb for question 4: if the function only shows something on screen, it may not need to return anything; if the program will use the result later, it should return it.
- Add a fifth function of your own — maybe one that finds the highest score, or one that checks whether the student passed every subject.
- For one of your functions, explain in a sentence *why* you chose to return a value, or why you chose not to.
The scenario
Mr. Owusu teaches a class and keeps each student's scores in a few subjects — say maths, English, and science. At the end of term he sits with one student's row of marks and has to work out how they did: their total across the subjects, how that averages out, whether it lands a distinction, a pass, or a fail, and a tidy report card to hand to the parent. Today he would write all of that as one long block of code, so when a number looks off — say the average seems too high — he has to reread the whole thing to find where it went wrong. Your job is to plan how to break this work into small, named pieces, so each part can be written and checked on its own. The worked example below is from last week's lesson, not the school — it is only there to show you what a finished answer looks like.
Name: greet
Information it needs: a person's name
Job: builds a short welcome line for that person
Returns an answer? Yes — it returns the greeting text, like
"Welcome, Ama!", so the program can print or reuse itHow we'll grade it
Four checks, four points. Three or above is passing — we'll ask you to revise anything we can't tick.
| Check | What we look for | Pt |
|---|---|---|
| Four functions | At least four functions, each doing a single, clear job rather than one function trying to do everything. | 1 |
| Right shape | Each function has a sensible verb-style name and lists the information (inputs) it would need. | 1 |
| Job is clear | Each function's job is described in plain words a non-programmer could follow. | 1 |
| Return decision | For each function you say whether it returns an answer, and the choice makes sense — print-only versus handing a value back. | 1 |