Work through the list without notes. If you cannot do a statement, follow its link, then come back. Guide = study guide; Practice = practice questions.
Understanding
- I can say what each of
+=,-=,*=,/=and%=does. (Guide: the table in “Updating a variable from its own value”; Practice Question 1) - I can say what
++and--do and that this course uses them after the variable, as statements. (Guide: “Adding and subtracting 1”; Practice Question 3) - I can explain that the whole right side of a compound assignment is evaluated before it is combined with the variable. (Guide: the bracket note; Practice Questions 2 and 5)
- I can explain how the variable’s type affects
/=. (Guide: “Tracing a sequence”; Practice Questions 4 and 6)
Skills
- I can rewrite a compound assignment as an ordinary assignment with brackets around the right side. (Guide: the table; Practice Question 5)
- I can trace a sequence of compound assignments in a table, using the value left by the previous statement. (Guide: Worked example 1; Practice Question 7)
- I can use compound assignment to accumulate a total, apply a multiplier and share it out. (Guide: Worked example 2)
- I can split a quantity into parts using
/and%=. (Guide: Worked example 2; Practice Question 8)
Reasoning
- I can explain why
x =+ 5is not the same asx += 5. (Guide: “Common misconceptions”) - I can explain why
n *= 1.5compiles for anintvariable whilen = n * 1.5does not, and what value results. (Guide: “A detail to notice”; Practice Question 9) - I can say why money is better kept as an
intnumber of pence when using integer division and the remainder. (Guide: Worked example 2)
All ticked? Move on to the Topic 1.7 study guide, Application Program Interface (API) and Libraries, or return to the course roadmap.