Econ: R20 page 732 Q6

for Econ, reading 20, page 732, Q6: does it use some kind of formula to trace the account activities? I have difficulty to understand the solution. Thanks.