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.
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.
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 join the discussion.
Loading…