Question 1
1 markWrite a pseudocode statement that adds the value stored in the variable Cost to a running total stored in the variable Bill.
Model answer
Bill ← Bill + Cost
Explanation
Totalling adds the new value to the existing total and stores the result back in the same variable. The assignment arrow ← is used in Cambridge pseudocode, never =, which is only used to compare values.
Mark scheme
-
1 mark
Bill ← Bill + Cost
Accept Bill ← Cost + Bill. Do not accept = instead of ←, or Bill + Cost on its own.