Friday, March 16, 2012

Challenge 055’s Solution

All three statements will successfully transfer money from one account to the other. Statement I removes $50 from the BankAccount object b and transfers it to the SavingsAccount object timsSavings, leaving b with $600 and s with $1,550. Statement II removes $30 from timsSavings and transfers it to the CheckingAccount object daynasChecking, leaving timsSavings with $1,470 and daynasChecking with $2,030. Finally, statement III removes $55 from daynasChecking and transfers it to b, leaving daynasChecking with $1,970 and b with $705.

−Phoenix

1 comment: