Year 7 Variable Understanding Checking


1. What are the final values stored in variables A and B after the following lines of code have executed by a computer?


A = 12

B = 7

A = B


2. What are the final values stored in variables A and B after the following lines of code have executed by a computer?


A = 12

B = 7

A = B

B = 3


3. What are the final values stored in variables A and B after the following lines of code have executed by a computer?


A = 12

B = 7

A = B

B = A


4. What are the final values stored in variables A, B and C after the following lines of code have executed by a computer?


A = 12

B = 7

C = 5

A = B

B = C


5. What are the final values stored in variables A and B after the following lines of code have executed by a computer?


A = 12

B = 7

A = A - B


6. What are the final values stored in variables A and B after the following lines of code have executed by a computer?


A = 10

B = 3

C = 1

A = B - C


7. What are the final values stored in variables A, B and C after the following lines of code have executed by a computer?


A = 12

B = A

C = B

A = B - C


8. What are the final values stored in variables A and B after the following lines of code have executed by a computer?


Cat = "Tom"

Mouse = "Jerry"

A = "Tom"

B = Mouse