ITEC 1620 Lecture 15: 1620_lecture_15
Document Summary
Constructs a new money amount with 0 dollars and 0 cents. The api for the money class is given below. Each instance of this class represents an amount of dollars and cents. The amount of cents will be an integer between 0 and 99 (inclusive), and the amount of dollars will never be less than zero. The api for the bankaccount class is given below. Each instance of this class has a balance with a certain amount of money. Constructs a new bankaccount with a zero balance (i. e. no money). Constructs a new bankaccount where the initial balance is equal to the given amount of money. equals(money amount) Returns true if this money amount is equal to amount. isgreaterorequals(money amount) Returns true if this money amount is greater than of equal to amount. Adds the given amount of money to the current balance. getbalance() Returns the amount of money currently in this bankaccount. withdraw(money amount)