print keyword

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

print keyword

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which is the correct VCAA maths pseudocode statement to output a result?
A print area
B display area
2. Where in a VCAA pseudocode algorithm should print statements appear?
A Before input — to show what the user should enter
B After processing — to display the final result
3. Which style of pseudocode uses Print with a capital P?
A VCE Software Development Begin...End pseudocode
B VCE Maths pseudocode
4. Can print output a computed expression directly?
A No — print can only output stored variables
B Yes — for example: print total / count
5. Which correctly outputs a result in VCAA maths pseudocode?
A print result
B PRINT result

Match the Pairs

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

Left columnRight column
1print area AAlgorithm: find area input l, w area <- l * w print area
2print total / count BWrong — print must come after input and processing. Printing result before n has been entered and result has been calculated produces no meaningful output
3print outputs the result after all input and processing has been completed CEvaluates the expression total divided by count and outputs the computed result directly without storing it in a variable
4Capital-P Print is used in Software Development Begin...End pseudocode, not in VCAA maths pseudocode DOutputs the current value stored in the variable area to display it as the result of the algorithm
5display answer EBegin result <- a + b Print result End
6print result input n result <- n * 2 FWrong — `display` is not a VCAA pseudocode keyword. The correct output keyword is `print`. The line should read `print answer`

Definitions

print

Fill in the Blanks

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

1.
_____ area
2.
Algorithm: show total input a, b total <- a + b _____ total
3.
input x result <- x * 2 _____ result
4.
average <- total / count _____ average
5.
Begin result <- a + b _____ result End

Spot the Error

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

Question 1
A Algorithm: show value
B input n
C display n
Question 2
A Algorithm: compute sum
B input a, b
C print a + b <- total
D print total
Question 3
A Algorithm: output result
B print result
C input n
D result <- n * 2
Question 4
A Algorithm: show square
B input n
C square <- n * n
D PRINT square
Question 5
A Algorithm: average two
B input x, y
C average <- (x + y) / 2
D print average
E input z

Answer Key

print keyword
Section A: Quick Questions
Q1
A — print area
Q2
B — After processing — to display the final result
Q3
A — VCE Software Development Begin...End pseudocode
Q4
B — Yes — for example: print total / count
Q5
A — print result
Section B: Match the Pairs
Q1
print area → Outputs the current value stored in the variable area to display it as the result of the algorithm
Q2
print total / count → Evaluates the expression total divided by count and outputs the computed result directly without storing it in a variable
Q3
print outputs the result after all input and processing has been completed → Algorithm: find area input l, w area <- l * w print area
Q4
Capital-P Print is used in Software Development Begin...End pseudocode, not in VCAA maths pseudocode → Begin result <- a + b Print result End
Q5
display answer → Wrong — `display` is not a VCAA pseudocode keyword. The correct output keyword is `print`. The line should read `print answer`
Q6
print result input n result <- n * 2 → Wrong — print must come after input and processing. Printing result before n has been entered and result has been calculated produces no meaningful output
Section C: Definitions
Q1
print — A VCAA pseudocode keyword that outputs a value, variable or expression as a result. Example: print area displays the current value stored in the variable area
Section D: Fill in the Blanks
Q1
print area
Q2
Algorithm: show total input a, b total <- a + b print total
Q3
input x result <- x * 2 print result
Q4
average <- total / count print average
Q5
Begin result <- a + b Print result End
Section E: Spot the Error
Q1
C — `display n` is not valid VCAA pseudocode. The correct keyword for outputting a value is `print`. The line should read `print n`. Line 2 is wrong.
Q2
C — `print a + b <- total` incorrectly mixes print with an assignment. print only outputs a value — it cannot assign. The assignment `total <- a + b` and the output `print total` must be on separate lines. Line 2 is wrong.
Q3
B — `print result` appears before result has been given a value. print must come after input and processing, not before them. Line 1 is wrong.
Q4
D — `PRINT square` uses all capitals, which is not standard VCAA maths pseudocode. The correct form is `print square` in lowercase. Capital-P `Print` is used in SD Begin...End style, not PRINT in all capitals. Line 3 is wrong.
Q5
E — `input z` appears after `print average`, which is out of order. All input statements should appear before processing and output. An input after the final print statement has no purpose in this algorithm. Line 4 is wrong.