04 Try it yourself Interactive

Change one address, then lose five thousand rupees

Two operations, run twice. Asha files a change of address at the admissions counter, and then asks for 5,000 rupees of her fee advance to be moved to her hostel deposit. Her advance is 9,000 and her deposit is 3,000, so the college’s books read 12,000 before the transfer and must still read 12,000 after it. A power cut lands between the two writes in both runs, at exactly the same instant. Files is the two-file world from section 02. DBMS is the same two operations with a database underneath. Nothing plays on its own: Next, Back and Reset, or the arrow keys.

Files
admissions.dat + library.dat · two copies
The left and middle cards are the two places the data is kept. The right card is what any other reader would get if they asked at this instant. Indigo marks the card this step touches.
Press Next to begin. Each press advances the run by one step.


      
Address copies
Copies gone stale
Rupees on the books
Missing from the total0
step 0 / 0