Output with OUTPUT

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

Output with OUTPUT

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which statement displays the word Hello exactly as written?
A OUTPUT Hello
B OUTPUT "Hello"
2. Score ← 25. What does OUTPUT Score display?
A Score
B 25
3. Score ← 25. What does OUTPUT "Score" display?
A Score
B 25
4. Which keyword displays a value to the user in Cambridge pseudocode?
A OUTPUT
B INPUT
5. Which line shows the value stored in the variable Lives?
A OUTPUT Lives
B OUTPUT "Lives"

Match the Pairs

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

Left columnRight column
1OUTPUT "Hello" AThe quotes make this the word Score rather than the value stored in the variable. To show the value, write OUTPUT Score.
2OUTPUT Score BDisplays the text Hello exactly as written, because it is in double quotes
3Show the words Game Over on the screen exactly as written COUTPUT Total
4Show whatever number is stored in the variable Total DDisplays the value currently stored in the variable Score
5OUTPUT Hello EOUTPUT "Game Over"
6OUTPUT "Score" FThe text has no double quotes, so Hello is treated as a variable name instead of text to display. It should be OUTPUT "Hello".

Definitions

OUTPUT

Fill in the Blanks

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

1.
______ "Hello"
2.
Score ← 10 OUTPUT _____
3.
Score ← 42 ______ Score
4.
Lives ← 3 OUTPUT _____
5.
Points ← 50 OUTPUT "Points" OUTPUT ______

Spot the Error

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

Question 1
A DECLARE Score : INTEGER
B Score ← 10
C OUTPUT "Score"
Question 2
A DECLARE Name : STRING
B Name ← "Sam"
C OUTPUT "Hello"
D PRINT Name
Question 3
A OUTPUT "Welcome"
B OUTPUT "to the game"
C OUTPUT "Good luck
Question 4
A OUTPUT Enter your name
B INPUT Name
C OUTPUT Name
Question 5
A DECLARE Score : INTEGER
B Score ← 5
C Score ← Score + 2
D OUTPUT = Score

Answer Key

Output with OUTPUT
Section A: Quick Questions
Q1
B — OUTPUT "Hello"
Q2
B — 25
Q3
A — Score
Q4
A — OUTPUT
Q5
A — OUTPUT Lives
Section B: Match the Pairs
Q1
OUTPUT "Hello" → Displays the text Hello exactly as written, because it is in double quotes
Q2
OUTPUT Score → Displays the value currently stored in the variable Score
Q3
Show the words Game Over on the screen exactly as written → OUTPUT "Game Over"
Q4
Show whatever number is stored in the variable Total → OUTPUT Total
Q5
OUTPUT Hello → The text has no double quotes, so Hello is treated as a variable name instead of text to display. It should be OUTPUT "Hello".
Q6
OUTPUT "Score" → The quotes make this the word Score rather than the value stored in the variable. To show the value, write OUTPUT Score.
Section C: Definitions
Q1
OUTPUT — OUTPUT displays a value to the user. OUTPUT "Hello" shows the text exactly as written. OUTPUT Score shows the value stored in the variable Score.
Section D: Fill in the Blanks
Q1
OUTPUT "Hello"
Q2
Score ← 10 OUTPUT Score
Q3
Score ← 42 OUTPUT Score
Q4
Lives ← 3 OUTPUT Lives
Q5
Points ← 50 OUTPUT "Points" OUTPUT Points
Section E: Spot the Error
Q1
C — Text in double quotes is shown exactly, so this displays the word Score. To show the value stored in the variable (10), remove the quotes: OUTPUT Score.
Q2
D — Cambridge pseudocode uses the keyword OUTPUT to display a value, not PRINT. It should be OUTPUT Name.
Q3
C — The text is missing its closing double quote. Text must be wrapped in a pair of double quotes: OUTPUT "Good luck".
Q4
A — Text to be shown exactly must be in double quotes. Without them, Enter your name is not valid. It should be OUTPUT "Enter your name".
Q5
D — OUTPUT is followed directly by the value to display. There is no equals sign. It should be OUTPUT Score.