Question
In Java 8.0 The Cash class. The Cash class represents an account that deals in money. The Cash class will have a balance, an interest
In Java 8.0
The Cash class. The Cash class represents an account that deals in money. The Cash class will have a balance, an interest rate, and a record of the amount of interest earned. The class should have the following methods.
-
getBalance: takes no input and returns a double that is the current balance in the account.
-
getInterestRate: takes no input and returns a double that is the interest rate.
-
setInterestRate: takes a double as input and returns nothing. Changes the interest rate.
-
transfer: takes a double as input and returns nothing. Reduces the current balance by the input amount.
-
getInterestEarned: takes no input and returns a double that is the amount of interest accrued this month.
-
processDay: takes no input and returns nothing. If the account balance is positive, multiplies the balance by the interest rate (divided by 365) and adds the amount to the current monthly interest.
-
processMonth: takes no input and returns nothing. Adds the current monthly interest to the balance and sets the current monthly interest to zero.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started