Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
This Comparison Operators in Pseudocode worksheet is part of the VCE Pseudo Code journey. Print it as a booklet?
Shade in the A or B circle for each question.
if x != y then check in VCAA pseudocode?Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1if score >= 50 then print "Pass" end if | AWrong — VCAA pseudocode uses a single = for equality, not ==. The correct form is `if score = 50 then` | |
| 2if x != y then print "Different" end if | BWrong — the operator => reverses the correct symbol. Greater than or equal to in VCAA pseudocode is written >= with the greater-than sign first | |
| 3The = operator checks for equality in VCAA pseudocode — a single equals sign, not double | Cif total = 0 then print "Empty" end if | |
| 4The <= and >= operators return true when the two values are equal as well as when one is strictly smaller or larger | DUses the != operator to check if x and y hold different values; the branch executes only when they are not equal | |
| 5if age => 18 then | Eif count <= 10 if score >= 80 | |
| 6if score == 50 then | FUses the >= operator to check if score is 50 or more; the then branch executes when the condition is true |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
>= — A VCAA pseudocode comparison operator meaning greater than or equal to. Returns true when the left value is greater than or equal to the right value. Example: age >= 18if age >= 18 thenif score < 50 thenif total != 100 thenwhile count <= limitif x = y then