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. 25 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 15 Sept 2026
Preview
The whole resource, exactly as a class sees it. Answers and marking are held back.
Thinking ahead: inputs, outputs and preconditions
Before designing a solution, a programmer needs to know what data will enter the system, what results it must produce and what must already be true for the solution to work. Thinking about these points before coding can prevent missing requirements and unsuitable designs.
By the end, you will be able to
- identify input and output data, including its meaning and format;
- distinguish data from input and output devices;
- state clear, testable preconditions;
- explain how missing information can change a solution.
Remember: a data type describes a value. An input device is a piece of hardware.
Identify the data, not only the hardware
A keyboard is a device; the requested ticket count entered through it is input data. A screen is a device; the allocation message shown on it is output data. In an exam answer, name the information being entered or produced, not just the hardware used.
An output can be digital, such as a Boolean value or an on-screen message. It can also be hard copy, such as a printed ticket. A precise answer gives the value and its meaning: “requested ticket count as a positive integer” is better than “number” or “keyboard”.
Worked allocation specification
Scenario: allocate accessible seating for an event.
- Inputs: event ID as a string; requested seats as a positive integer; whether step-free access is required as a Boolean.
- Outputs: an accepted or rejected message; a list of allocated seat IDs; the remaining capacity as an integer.
- Preconditions: the event ID exists; the current seating data has been loaded; the requested number of seats is at least 1.
These preconditions affect the design. For example, the program must reject an unknown event ID before it tries to allocate a seat. Thinking ahead therefore changes the solution before any 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 information from a function
function canAllocate(requested, remaining)
if requested >= 1 AND requested <= remaining then
return True
endif
return False
endfunction
Use the function header to find the input data. Use each return statement to identify the possible output. A precondition is a fact that must already be true before the function is used.
Do not copy every condition from an if statement and call it a precondition. This function checks whether requested is at least 1 and no greater than remaining; it can return False when that condition is not met. Stronger preconditions include both parameters being integers and remaining being an up-to-date, non-negative capacity.
Identify both input data items, the output, and two preconditions for the supplied function.
Identify the parameter values and returned result. Then state two facts the function relies on but does not check for itself.
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 and closure data be?
These are unanswered requirements. Different answers may change the input data, the algorithm and the output. A precondition is useful when it states a fact that the solution needs to rely on, such as the user's starting location being known.
Choose two unanswered questions from the event-recommendation brief. Give one plausible answer to each question and explain how that answer would change the solution.
For each point, write: answer to the question → change to the input data, filtering, ranking or output.
Students type their answer here.
Independent application: bicycle hire
A bicycle-hire system reserves a suitable bicycle at a chosen station. It must return either a reservation confirmation or a clear reason why the request was rejected.
State three input data items, two outputs and two preconditions for the bicycle-hire system. Then explain how one of your preconditions affects the solution's design.
Name the information, not only a device. Include details such as data type or valid range where they make the answer clearer.
Students type their answer here.
Checkpoint
Complete the distinctions from memory. Use the precise terms you have learned; your teacher will review your answers.
Review your understanding
Before submitting, check that you can name input and output data rather than devices, state a testable precondition, and explain how that precondition affects the design.