CS10-03 Computer Science Watch
Inputs, processing and outputs
In this lesson
Inputs, processing and outputs for GCSE Computer Science, with worked examples and the mistakes examiners report. AQA 8525 and OCR J277 GCSE. Algorithms 3 of 9. More at https://scholafly.com
By the end: Identify precisely the inputs, the processing and the outputs of a problem or a short algorithm, work out what a short algorithm is for by reading it, and draw a simple structure diagram of a problem.
What it covers
- 0:00 Intro: inputs, processing and outputs
- 0:37 Inputs, processing and outputs: input, process, output
- 2:48 Reading an algorithm
- 4:42 Trying values
- 6:51 Structure diagrams
Key words
About this video
Inputs, processing and outputs | GCSE Computer Science | CS10-03
Inputs, processing and outputs for GCSE Computer Science, with worked examples and the mistakes examiners report.
AQA 8525 and OCR J277 GCSE. Algorithms 3 of 9.
More at https://scholafly.com
Watch first: CS10-01 - https://youtu.be/pCbMQpRnmuE
Video code: CS10-03 (search "ScholaFly CS10-03")
#GCSEComputerScience #Algorithms
For teachers
This GCSE Computer Science lesson teaches inputs, processing and outputs. By the end, students should be able to identify precisely the inputs, the processing and the outputs of a problem or a short algorithm, work out what a short algorithm is for by reading it, and draw a simple structure diagram of a problem. It works through four worked examples and the mistakes examiners report.
Exam board specification references:
AQA 8525
- 3.1.1
OCR J277
- 2.1.2
Read the transcript
Pick a can from a vending machine, but that can has sold out, and nothing drops. Did the machine do anything at all? Nothing came out, so it is tempting to say no. But something did happen, and it can be pinned down without looking inside. Three questions do it: what goes in, what comes out, and what happens between. They crack an algorithm you have never seen, too.
Every algorithm can be read with three questions: what comes in, what is done to it, and what goes out. Input is the data that enters. Processing is anything done to that data, such as calculating, comparing or deciding. Output is the data that comes out. For the vending machine, the inputs are the value of the coin and which button was pressed. The processing checks the money and works out the change. The outputs say which can to release and how much change to give. Every input there is data. Not the coin, but its value. Not your finger, but which button it pressed. If it could not be typed, scanned or sensed, it is not an input. Take the search feature on a video-sharing website. What are two inputs and two outputs of that search, each one real data? Inputs: the keywords typed into the search box, and a filter chosen, such as upload date. Outputs: a list of matching titles, and the number of results. One examiner's report, on a question about videos, puts it this way: "Answers such as 'video' as input are problematic because the candidate would not upload or use a video for their input." It goes on: "Candidates who were more precise and used terms such as 'name of video' or 'keywords searched for' were positively recognised for this." The fix is to name the data, not the thing. Nobody types a video into a search box; they type its name.
Reading an algorithm works the same way, one line at a time. Here is one in plain numbered steps. Ask for three numbers. Store the first as biggest. If the second is bigger than biggest, store it as biggest. If the third is bigger than biggest, store it as biggest. Display biggest. Which line numbers are input, which are processing, and which is output? Line one is the input. Lines two, three and four are processing. Line five is the output. Lines three and four only compare and decide, and that still counts as processing, because they do something to the data between going in and coming out. Now, in one short sentence, what is this algorithm for? It finds and displays the largest of three numbers. Compare that with a retelling: it asks for three numbers, then it stores the first, then it checks the second. Every word of that is true, and it is still not a purpose. A purpose is one short sentence that someone who has never programmed would understand. It says what the algorithm achieves, not what each line does.
Sometimes reading is not enough. Putting a value or two through the algorithm shows what it does. Take a number. If it leaves no remainder when it is shared by two, display even. Otherwise, display odd. Odd or even: what is output for seven, then for twelve, when each is divided by two? Seven divided by two leaves one over, so the output is odd. Twelve divided by two leaves nothing over, so the output is even. One examiner's report records how questions like this go: "Question 2.2 asked for the output of an algorithm corresponding to a given input, and less than half of students managed this." The way to fix that is to walk the algorithm one line at a time, writing each value down beside it, never guessing. A trace table is the tidy version of this, and the video Trace tables teaches it. Now look across both of those outputs. What is this algorithm for? It tells you whether a whole number is odd or even. A report on an older version of one course adds a line about this step: "Fewer students were able to identify the purpose of the algorithm." Tracing gives values, and the purpose is the sentence you write after looking at them. The habit: after every walk-through, ask what the outputs have in common.
A structure diagram is a picture of a problem's parts. The whole problem sits at the top, its parts sit below it, and plain lines join them. It shows what the parts are, not the order they run in, so it has no arrows and no decisions. A flowchart, a diagram of steps in the order they run, is a different thing, with its own video, Flowcharts. One course asks for structure diagrams by name, and on any course they are a quick way to plan. Each part is a job, so a structure diagram is decomposition, drawn. A quiz program has to show the questions, check each answer, keep the score, and show a final result. Draw its structure diagram, and give check each answer a level of its own underneath. Draw it on paper, with the level under check each answer, before I show you. Quiz program goes at the top. Below it sit four boxes: show the questions, check each answer, keep the score, show the final result. Under check each answer go two more boxes: compare the answer with the correct one, and tell the player right or wrong. Plain lines join them, with no arrows anywhere.
Four questions to close: two on problems this video has not shown, then two back on its own ideas. A music app's search: is the input the song, or the song title typed in? The title typed in. The app receives data, so the input is the words, not the song itself. Try this: double a number, add one, display it. What is output when the number is five? Eleven. Five doubled is ten, and ten plus one is eleven. Here's another: what does a structure diagram never have that a flowchart does? Arrows. A structure diagram shows the parts, not the order they run in. One more, the vending machine: a sold-out can is chosen. What is the processing doing? Checking whether that can is in stock, then deciding to release nothing. So the machine was busy after all: checking and deciding are processing too.
Here is where this video sits in the list. A thumbs up says you own this one, and it saves you watching it again; leave it blank and it stays on your list to revisit. If it has not landed yet, save it, give it a day, and read one short algorithm with fresh eyes tomorrow.
Next in the chapter: Flowcharts, where algorithms are drawn with six standard shapes. Hopefully that's next in your feed, but if not, search for ScholaFly C S ten, oh four.
Every other video is on scholafly.com too, easy to search by video code or by keyword. Whatever you're revising, go there and have a look, or, watch the next video.
Related terms
For: AQA GCSE 8525, OCR GCSE J277
On the specification
For teachers
This GCSE Computer Science lesson teaches inputs, processing and outputs. By the end, students should be able to identify precisely the inputs, the processing and the outputs of a problem or a short algorithm, work out what a short algorithm is for by reading it, and draw a simple structure diagram of a problem. It works through four worked examples and the mistakes examiners report.