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

Inputs, preconditions, process and outputsInput datarequest, age, access needPreconditionsevent exists; capacity knownAllocate ticketvalidate → decide → recordOutput datastatus, seat, message

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.

Multiple choice1 mark

Which option identifies input data rather than only an input device?

  • ATouchscreen
  • BBarcode scanner
  • CRequested seat count entered as an integer
  • DMicrophone
Fill in the blanks3 marks
The event identifier is an gap 1, the allocation message is an gap 2, and “the event exists” is a gap 3.
  • 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.

Written answer5 marks

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.

Written answer4 marks

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.

Written answer10 marks

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.

Fill in the blanks4 marks
A keyboard is a hardware checkpoint gap 1, while the requested seat count is input checkpoint gap 2. A printed ticket is a checkpoint gap 3 output. Resolving a missing condition may change the data, checkpoint gap 4 or result produced by the solution.

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.