OUTPUT

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

OUTPUT

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which line correctly displays the text Hello on the screen?
A OUTPUT "Hello"
B OUTPUT Hello
2. Score holds the number 50. Which line displays the value 50?
A OUTPUT "Score"
B OUTPUT Score
3. What does OUTPUT "Score" display?
A The value stored in the variable Score
B The word Score
4. Lives holds 3. Which line displays: You have 3 lives left?
A OUTPUT "You have ", Lives, " lives left"
B OUTPUT "You have " Lives " lives left"
5. Which keyword is used in IGCSE pseudocode to display a value on the screen?
A OUTPUT
B output

Match the Pairs

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

Left columnRight column
1OUTPUT Score AOUTPUT Score * 2
2OUTPUT "You have ", Lives, " lives left" BOUTPUT "Game over"
3Text must be written inside double quotes so it is displayed exactly as written CThe commas are missing between the values. Each text and variable must be separated by commas.
4An expression can be output and the result of the calculation is displayed DThe variable name is inside double quotes, so the word Score is displayed instead of the value stored in the variable. Remove the quotes to output the value.
5OUTPUT "Score" EDisplays the current value stored in the variable Score on the screen
6OUTPUT "You have " Lives " lives left" FDisplays text and a variable value together, with the values separated by commas

Definitions

OUTPUT

Fill in the Blanks

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

1.
Score ← 50 ______ "Score: ", Score
2.
Lives ← 3 OUTPUT "You have ", _____, " lives left"
3.
Score ← 10 Bonus ← 5 OUTPUT Score _ Bonus
4.
Name ← "Sam" OUTPUT "Hello ", ____
5.
Price ← 8 Qty ← 3 OUTPUT "Cost: ", Price _ Qty

Spot the Error

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

Question 1
A DECLARE Score : INTEGER
B Score ← 10
C Score ← Score + 5
D OUTPUT "Score: " Score
Question 2
A OUTPUT Enter your name
B INPUT Name
C OUTPUT "Hello ", Name
Question 3
A Lives ← 3
B Lives ← Lives - 1
C OUTPUT "You have ", "Lives"
Question 4
A Price ← 4
B Qty ← 3
C Total ← Price * Qty
D OUTPUT "Total: "; Total
Question 5
A Side ← 5
B OUTPUT "Area: ", "Side * Side"
C OUTPUT "Done"

Answer Key

OUTPUT
Section A: Quick Questions
Q1
A — OUTPUT "Hello"
Q2
B — OUTPUT Score
Q3
B — The word Score
Q4
A — OUTPUT "You have ", Lives, " lives left"
Q5
A — OUTPUT
Section B: Match the Pairs
Q1
OUTPUT Score → Displays the current value stored in the variable Score on the screen
Q2
OUTPUT "You have ", Lives, " lives left" → Displays text and a variable value together, with the values separated by commas
Q3
Text must be written inside double quotes so it is displayed exactly as written → OUTPUT "Game over"
Q4
An expression can be output and the result of the calculation is displayed → OUTPUT Score * 2
Q5
OUTPUT "Score" → The variable name is inside double quotes, so the word Score is displayed instead of the value stored in the variable. Remove the quotes to output the value.
Q6
OUTPUT "You have " Lives " lives left" → The commas are missing between the values. Each text and variable must be separated by commas.
Section C: Definitions
Q1
OUTPUT — Displays text in double quotes, variable values or expressions on screen. Several values are separated by commas, e.g. OUTPUT "Score: ", Score
Section D: Fill in the Blanks
Q1
Score ← 50 OUTPUT "Score: ", Score
Q2
Lives ← 3 OUTPUT "You have ", Lives, " lives left"
Q3
Score ← 10 Bonus ← 5 OUTPUT Score + Bonus
Q4
Name ← "Sam" OUTPUT "Hello ", Name
Q5
Price ← 8 Qty ← 3 OUTPUT "Cost: ", Price * Qty
Section E: Spot the Error
Q1
D — Several values in an OUTPUT statement must be separated by commas. The comma is missing between the text and Score. It should be OUTPUT "Score: ", Score.
Q2
A — Text to display must be written in double quotes. Without quotes, pseudocode treats the words as variable names. It should be OUTPUT "Enter your name".
Q3
C — A variable must not be in double quotes, or the word Lives is displayed instead of its value. It should be OUTPUT "You have ", Lives.
Q4
D — Values in an OUTPUT statement are separated by commas, not semicolons. It should be OUTPUT "Total: ", Total.
Q5
B — An expression must not be in quotes, or the characters Side * Side are displayed as text. Without quotes OUTPUT works out the value. It should be OUTPUT "Area: ", Side * Side.