GNU Smalltalk User's Guide
4.4.6 Moving money around
We can now create accounts, and look at them. As it
stands, though, our balance will always be 0--what a tragedy!
Our final methods will let us deposit and spend money.
They're very simple:
!Account methodsFor: 'moving money'!
balance := balance - amount
balance := balance + amount
With these methods you can now deposit and spend amounts of
money. Try these operations:
a deposit: 125!
a deposit: 20!
a spend: 10!