From: Rimantas Liubertas Date: 2006-11-03T22:20:07+09:00 Subject: Re: Output not clear > def withdraw(amt) > @bal = balance > if ((@bal - amt) > 500.00) > balance = @bal - amt > puts balance.to_s > else > puts 'No Balance' > end > end > end > > s = Savings.new('Pete',65241884,5000.00) > s.deposit(500.00) > s.withdraw(200.00) > puts s.balance.to_s > > The output I get is: > > >ruby accounts.rb > 5500.0 > 5300.0 > 5500.0 > >Exit code: 0 > > I thought that the last line puts s.balance.to_s would have displayed 5300.0. > Why is this 5500.0 ? Because you do not change @balance in your withdraw method. Regards, Rimantas -- http://rimantas.com/