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:

  1. getLoanLimit: takes no input and returns a double that is the loan limit.

  2. setLoanLimit: takes a double as input and returns nothing. Changes the loan limit .

  3. getOverdraftPenalty: takes no input and returns a double that is the overdraft penalty.

  4. setOverdraftPenalty: takes a double as input and returns nothing. Changes the overdraft penalty.

  5. 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.
  6. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!