This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: -- with initial_depost--======================== feature -- Element change f deposit (amount: REAL) is-- Add the amount to the account balance require positive_amount: amount> 0 do balance := balance + amount ensure proper_balance: balance = old balance + amount end withdraw (amount: REAL) is-- Subtract the amount from the account balance require positive_amount: amount > 0 amount <= balance do balance := balance - amount ensure proper_balance: balance = old balance - amount end invariant balance_not_negative: balance >= 0 end -- class SAVINGS_ACCOUNT...
View Full Document
This note was uploaded on 04/03/2010 for the course COMPUTER S CSE 3221 taught by Professor Hui during the Spring '10 term at York University.
- Spring '10