Variable Assignment: x <- value

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

Variable Assignment: x <- value

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which is the correct VCAA pseudocode assignment statement?
A x = 5
B x <- 5
2. In VCAA pseudocode, which side of <- does the variable name go on?
A Left side: x <- 5
B Right side: 5 <- x
3. What does total <- total + 1 do in VCAA pseudocode?
A Increases total by 1 and stores the result back in total
B Compares total to total + 1
4. Which statement correctly initialises a counter to zero in VCAA pseudocode?
A count <- 0
B count = 0
5. Can a variable appear on both the left and right side of <- in the same statement?
A No — the variable can only appear once
B Yes — for example score <- score + points

Match the Pairs

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

Left columnRight column
1x <- 5 Atotal <- 0 total <- total + price print total
2count <- count + 1 Bscore <- 0 score <- score + 10 score <- score + 5
3The variable name must appear on the LEFT side of the <- operator CWrong — VCAA pseudocode uses <- for assignment, not =. The correct statement is total <- total + 1
4A variable stores a value that can be updated at any point using the <- operator DIncreases count by 1 — the right side is evaluated using count's current value, then the result is stored back into count
55 <- x EAssigns the value 5 to the variable x using the VCAA pseudocode left-arrow assignment operator
6total = total + 1 FWrong — the variable must be on the LEFT of <-, not the right. The correct form is x <- 5

Definitions

<-

Fill in the Blanks

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

1.
x __ 5
2.
total __ 0
3.
count <- _____ + 1
4.
score <- score + ______
5.
______ <- price * quantity

Spot the Error

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

Question 1
A Algorithm: set a value
B 5 <- x
C print x
Question 2
A Algorithm: update counter
B count <- 0
C count = count + 1
D print count
Question 3
A Algorithm: store input
B input price
C price < 0
D print price
Question 4
A algorithm: running total
B total <- 0
C total <- total + 10
D print total
Question 5
A input base, height
B area <- base * height
C area <- area / 2
D print area

Answer Key

Variable Assignment: x <- value
Section A: Quick Questions
Q1
B — x <- 5
Q2
A — Left side: x <- 5
Q3
A — Increases total by 1 and stores the result back in total
Q4
A — count <- 0
Q5
B — Yes — for example score <- score + points
Section B: Match the Pairs
Q1
x <- 5 → Assigns the value 5 to the variable x using the VCAA pseudocode left-arrow assignment operator
Q2
count <- count + 1 → Increases count by 1 — the right side is evaluated using count's current value, then the result is stored back into count
Q3
The variable name must appear on the LEFT side of the <- operator → total <- 0 total <- total + price print total
Q4
A variable stores a value that can be updated at any point using the <- operator → score <- 0 score <- score + 10 score <- score + 5
Q5
5 <- x → Wrong — the variable must be on the LEFT of <-, not the right. The correct form is x <- 5
Q6
total = total + 1 → Wrong — VCAA pseudocode uses <- for assignment, not =. The correct statement is total <- total + 1
Section C: Definitions
Q1
<- — The assignment operator in VCAA pseudocode. It stores a value in a named variable: x <- 5 places the value 5 into the variable x
Section D: Fill in the Blanks
Q1
x <- 5
Q2
total <- 0
Q3
count <- count + 1
Q4
score <- score + points
Q5
result <- price * quantity
Section E: Spot the Error
Q1
B — The variable name must appear on the left of <-, not the value. The correct form is `x <- 5`. You assign a value TO a variable, not the other way around. Line 1 is wrong.
Q2
C — VCAA pseudocode uses <- for assignment, not =. The correct statement is `count <- count + 1`. The equals sign is a comparison operator, not an assignment operator in VCAA pseudocode. Line 2 is wrong.
Q3
C — `price < 0` is a comparison, not an assignment. To assign 0 to price the correct statement is `price <- 0`. The <- operator is required for assignment. Line 2 is wrong.
Q4
A — In VCAA pseudocode the keyword Algorithm has a capital A. Writing `algorithm` in lowercase is incorrect — the header must read `Algorithm: running total`. Line 0 is wrong.
Q5
A — The algorithm is missing its Algorithm header. The first line must be the Algorithm declaration before any input or assignment statements. The input statement cannot appear on line 0 without a preceding Algorithm header. Line 0 is wrong.