Question
In Java The Loan class. The Loan class is a Cash class the represents money borrowed by the customer. The Loan class has all the
In Java
The Loan class. The Loan class is a Cash class the represents money borrowed by the customer. The Loan class has all the same properties and behaviors of the Cash class in addition to the loan limit, the overdraft penalty as well as whether the loan is overdrafted. The class should have all the methods of Cash except the processDay and processMonth will need additional behavior as listed below and there will be four new getter/setter methods to correspond to the additional features of the Loan class:
-
getLoanLimit: takes no input and returns a double that is the loan limit.
-
setLoanLimit: takes a double as input and returns nothing. Changes the loan limit .
-
getOverdraftPenalty: takes no input and returns a double that is the overdraft penalty.
-
setOverdraftPenalty: takes a double as input and returns nothing. Changes the overdraft penalty.
- processDay: takes no input and returns nothing. This method should have the same behavior as in the Cash class plus if the current balance exceeds the loan limit, then the method should record that the loan is overdrafted for this month.
- processMonth: takes no input and returns nothing. This method should have the same behavior as in the Cash class plus if the loan was ever overdrafted since the last time processMonth was called, then the overdraft penalty should be added to the balance.
The Loan class should have a single constructor that takes three double inputs: the interest rate, the loan limit, and the overdraft penalty.
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