Component parts of a problem: outputs

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Component parts of a problem: outputs

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A program shows 'Welcome, Sam!' on the monitor. Is this an output?
A Yes - it is a result the solution gives out on a screen
B No - only printed results count as outputs
2. A student types their password on a keyboard. Which part of the problem is this?
A An output, because the keyboard is a device
B An input, because data goes into the system
3. Which of these is an output?
A A receipt printed after a purchase
B A barcode scanned at the till
4. A smart greenhouse sends a signal that switches a fan on when it is too hot. What is that signal?
A An output that controls an actuator
B An input from a sensor
5. A satnav says 'Turn left in 200 metres' aloud. Does this count as an output?
A No - outputs must be text on a screen
B Yes - a spoken result is an output

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1OUTPUT "Welcome, " & Name AShows a message on the screen that joins a greeting to the user's name
2OUTPUT "Heater ON" BINPUT is used where OUTPUT is needed. INPUT takes data in from the user, but a message that shows a result must use OUTPUT.
3A result shown on a screen is an output COUTPUT "Sprinkler ON"
4A signal that controls an actuator is an output DOUTPUT "Your total is ", Total
5INPUT "Your score is ", Score EThese are inputs, not outputs. The keypad and door sensor send data in. The outputs would be the siren and a warning message.
6Outputs for an alarm system: keypad code, door sensor FGives a signal or message that tells a device to switch on

Definitions

output

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
______ "Your total is ", Total
2.
Total ← Price * Quantity OUTPUT _____
3.
IF Temp _ 30 THEN OUTPUT "FAN ON" ENDIF
4.
_____ Name OUTPUT "Hello ", Name
5.
FOR Count ← 1 TO 3 OUTPUT Count NEXT _____

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A INPUT temp
B IF temp > 28 THEN
C fanSignal ← TRUE
D INPUT "Fan is on"
E ENDIF
Question 2
A score ← 85
B OUTPUT "Your score is , score
C OUTPUT "Well done"
Question 3
A INPUT name
B greeting ← "Hello "
C OUTPUT "greeting", name
Question 4
A PRINT "Enter your age"
B INPUT age
C OUTPUT "Age is ", age
Question 5
A INPUT light
B IF light < 20 THEN
C OUTPUT ← "Lamp ON"
D ENDIF

Answer Key

Component parts of a problem: outputs
Section A: Quick Questions
Q1
A — Yes - it is a result the solution gives out on a screen
Q2
B — An input, because data goes into the system
Q3
A — A receipt printed after a purchase
Q4
A — An output that controls an actuator
Q5
B — Yes - a spoken result is an output
Section B: Match the Pairs
Q1
OUTPUT "Welcome, " & Name → Shows a message on the screen that joins a greeting to the user's name
Q2
OUTPUT "Heater ON" → Gives a signal or message that tells a device to switch on
Q3
A result shown on a screen is an output → OUTPUT "Your total is ", Total
Q4
A signal that controls an actuator is an output → OUTPUT "Sprinkler ON"
Q5
INPUT "Your score is ", Score → INPUT is used where OUTPUT is needed. INPUT takes data in from the user, but a message that shows a result must use OUTPUT.
Q6
Outputs for an alarm system: keypad code, door sensor → These are inputs, not outputs. The keypad and door sensor send data in. The outputs would be the siren and a warning message.
Section C: Definitions
Q1
output — The result a solution gives out, such as a message on screen, a printout, a sound or a signal that switches a device on or off.
Section D: Fill in the Blanks
Q1
OUTPUT "Your total is ", Total
Q2
Total ← Price * Quantity OUTPUT Total
Q3
IF Temp > 30 THEN OUTPUT "FAN ON" ENDIF
Q4
INPUT Name OUTPUT "Hello ", Name
Q5
FOR Count ← 1 TO 3 OUTPUT Count NEXT Count
Section E: Spot the Error
Q1
D — INPUT reads data into the program. To show a message on the screen the line must use OUTPUT: OUTPUT "Fan is on".
Q2
B — The text message is missing its closing quote mark. It should be OUTPUT "Your score is ", score so that score is output as a value.
Q3
C — Quotes make greeting a piece of text, so the screen would show the word greeting. To output the value stored in the variable, write OUTPUT greeting, name.
Q4
A — Cambridge pseudocode uses OUTPUT to give a result or prompt on screen, not PRINT. It should be OUTPUT "Enter your age".
Q5
C — OUTPUT is a keyword, not a variable, so nothing can be assigned to it with ←. The line should be OUTPUT "Lamp ON".