Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions