Programming practice: sequence – OCR GCSE Computer Science lesson (J277)
Pupils learn to write, test and fix a complete trip planner program in sequence, using input, casting, assignment, arithmetic operators and output in the right order.
Lesson 12 of 13 in unit 10.1 Systems Architecture and First Programs, taught in Year 10, Autumn 1. It answers one big question: Why does the order of instructions matter in a program?
By the end, pupils can write, test and fix a complete trip planner program in sequence, using input, casting, assignment, arithmetic operators and output in the right order.
- The Build (the main task)
- Write the complete trip planner program: input the number of pupils and the cost per pupil, then calculate and print the total cost, the full minibuses of 16 and the pupils left over.
- Support version
- Parsons problem: the program's lines are jumbled, with one distractor line that casts the cost with int() instead of float(), so £7.50 crashes; a worksheet question asks what goes wrong if the total is printed before it is calculated.
- Challenge
- Fix a given version of the trip planner that runs without an error message but gives the wrong total.
- Real-world link
- The finished trip planner: the cost of the trip and the minibuses it needs, ready for a teacher to use.
- Key words
- Sequence, Assignment and Instruction, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “The order of the lines does not matter as long as all of them are there”; “= means 'equals' as in maths, so total = total + cost is impossible”.
- OCR J277 specification
- 2.2.1 (programming fundamentals: variables, constants, operators, input, output, assignment, sequence); 2.2.2 (data types and casting).
Every lesson follows the same Code & Commerce structure: a Bell Task recall starter, key vocabulary with definitions and icons, short teaching chunks with a check before pupils move on, The Build (one main task), challenge questions that get harder, and an exit question. Answers reveal one at a time on the slides, and everything is editable PowerPoint and Word.
Pupils need computers for the main task.
Also sold in the Systems Architecture and First Programs unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.
What's included
- Slide deck (PowerPoint)
- Lesson plan (Word)
- Worksheet (Word)
- Support worksheet with scaffolds (Word)
- Programming practice - sequence - Quiz Quiz Trade Cards
- Single-teacher licence: use and adapt it with your own classes
More for GCSE Computer Science (OCR)
See allPupils learn to describe a computer system as input, process, storage and output, and write an algorithm as precise numbered steps for a stated purpose.
Free sample lessonPupils learn to decompose a problem into smaller sub-problems in a structure diagram and use abstraction to decide which details a solution needs and which it can ignore.
Pupils learn to state the purpose of the CPU and describe von Neumann architecture, in which instructions and data are stored together in the same memory.
Written for the specifications named. Not endorsed by or affiliated with any exam board.