ITEC 1620 Lecture 15: 1620_lecture_15

37 views4 pages

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)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents