Community resourceWorksheet
OCR H446 2.1.2 Inputs, outputs and preconditions
Part 1 of 2 · H446 2.1.2 · Thinking ahead
Thinking ahead in OCR H446 2.1.2 begins with knowing exactly what data arrives, what leaves and what must already be true. A pop-up concert service and an accessible-seating allocator push students past naming input devices towards qualified data items and stated preconditions.
Students will:
- identify input and output data together with its meaning and format
- distinguish input data from the device that captures it
- state the preconditions that must hold before a process can run correctly
- read the inputs, output and preconditions out of a short pseudocode function
- specify a full data contract for a step-free seat allocation service
Inside: 8 explanation cells, 1 multiple-choice question, 2 fill-in-the-blanks cells and 3 written answers. 27 marks, about 25 to 35 minutes.
Series: H446 2.1.2 · Thinking ahead, part 1 of 2.
Shared by Coding PathwayVerified teacher
- 14 cells
- About 30 minutes
- CC BY-SA 4.0
- Shared 31 Aug 2026
- Updated 3 Sept 2026
Preview
The whole resource, exactly as a class sees it. Answers and marking are held back.
Thinking ahead: inputs, outputs and preconditions
A pop-up concert service must know what data arrives, what results it produces and what must already be true before allocation can work.
By the end, you will be able to
- identify input and output data, including meaning and format;
- distinguish data from input/output devices;
- state testable preconditions;
- explain how missing information changes a solution.
Reactivate: a data type describes the kind of value; an input device is hardware.
Look beyond the hardware
A keyboard is a device. The attendee’s requested ticket count entered through it is input data. A screen is a device. The allocation status displayed on it is output data.
Output can be digital, such as a returned Boolean or on-screen message, or hard copy, such as a printed ticket. In either case, identify the data and its useful format rather than naming only the output device.
A useful specification names the value and meaning: “requested ticket count as a positive integer”, not merely “number” or “keyboard”.
Worked allocation specification
Scenario: allocate accessible seating for an event.
- Inputs: event ID (string), requested seats (positive integer), step-free access required (Boolean).
- Outputs: accepted/rejected status (Boolean or message), allocated seat identifiers (list of strings), remaining capacity (integer).
- Preconditions: event ID exists; current seating data has loaded; requested seats is at least 1; capacity is not already being changed by another allocation.
If simultaneous updates are possible, the design needs locking or another consistency method. Thinking ahead has changed the solution before code is written.
Which option identifies input data rather than only an input device?
- ATouchscreen
- BBarcode scanner
- CRequested seat count entered as an integer
- DMicrophone
- input
- output
- precondition
- device
Extract data from a listing
function canAllocate(requested, remaining)
if requested >= 1 AND requested <= remaining then
return True
endif
return False
endfunction
Inputs are requested and remaining. The output is the returned Boolean. Preconditions not enforced by this function include both parameters being integers and remaining not being negative.
Identify both input data items, the output, and two preconditions for the supplied function.
Name meanings/types where possible; do not name devices.
Students type their answer here.
Guided missing-information check
A brief says: “Recommend a nearby event to the user.” Before devising a solution, ask:
- What counts as nearby: distance or journey time?
- Where is the user starting?
- Which transport modes are allowed?
- Must accessibility requirements be met?
- How current must event/closure data be?
Each answer can change the inputs, algorithm and outputs. A precondition is useful when its truth can be checked or clearly assumed.
Choose two missing conditions from the event-recommendation brief and explain how each answer would alter the solution.
Use condition → changed design/behaviour.
Students type their answer here.
Independent interface contract
Design the data contract for a service that allocates a step-free seat and returns a confirmation or a reason for rejection.
Specify at least four inputs, three outputs and three preconditions for the service. Qualify values with meaning or format.
Think about attendee request, event data, accessibility and capacity.
Students type their answer here.
Checkpoint
Repair the weak input/output descriptions from memory. There is no answer bank, and correctness is withheld until teacher review.
Review your understanding
Before submitting, check that you can explain the main distinction in your own words, apply it in an unfamiliar context and justify the resulting behaviour or consequence.