HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /A school gives every pupil a card for the canteen…
MediumComputer ScienceHigh School (9–10)Computer Science › Algorithms and Problem-SolvingConceptualIGCSE

A school gives every pupil a card for the canteen…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

A school gives every pupil a card for the canteen. Parents put money onto the card online. At the till, the pupil taps the card, the price of the meal is taken from the balance, and the new balance is shown. If the balance is too low, the meal is refused. Each evening the school sends parents a list of what their child bought.

Decompose this system into its inputs, processes, outputs and storage. Give at least two of each where you can.

Need a reminder? The key ideaShowHide

Every computer system is made of sub-systems, which are made of further sub-systems. Decompose a problem into its inputs, processes, outputs and storage. Abstraction keeps only the details that matter. A structure diagram shows the system at the top and its parts on each level below.

The worked solution

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Inputs. The card number when the card is tapped; the price of the meal at the till; the money a parent adds online.

Processes. Find the pupil's balance from the card number; check whether the balance is at least the price; take the price from the balance; add a parent's payment to the balance; make each evening's list.

Outputs. The new balance on the till screen; a "refused" message when the balance is too low; the evening list sent to parents.

Storage. The balance of each card; the list of meals each pupil bought that day; the parents' contact details.

Check. Each item fits one heading. The balance appears twice: it is stored, and it is also an output when it is shown. That is fine.

Watch out. "The pupil" is not an input. The data the system receives (the card number) is the input.

Log in to save this for later
← All Problems
← A programmer builds a program that works out a pupil's average mark from five tests…A structure diagram for a home weather station has the top box "Weather station"… →
More onComputer Science › Algorithms and Problem-Solving

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Decomposition, abstraction and structure diagramsPlanning a Program: Life Cycle, Decomposition and Flowcharts

More on this topic

  1. This is the kind of long scenario question that ends Paper 2…Hard
  2. A delivery company adds a check digit to each parcel number…Medium
  3. Name the check in each case. Say whether it is validation or verification…Easy
A bubble sort is changed so that it sorts in descending order: the comparison becomes IF…Hard
  • A shop stores the colours of the ten bicycles in its window in an array Colours: red, blue, red…Medium
  • All problems on this topic →