Make a program that will compute the monthly payment of a particular loan
- make a class named loan
- declare attributes amount loaned , duration , interest , total loaned and monthly payment
- declare setter and getter methods for amount loaned and duration
- create overloading constructor
- 1st constructor is a default
Constructor that assign 10000 to amount loan and 5 months for duration
- 2nd constructor accept single value for amount and assign 5 months for duration
- 3rd constructor accept 2 values for amount loan and duration
- Declare method getInterest that accept value for duration and return the interest based on the ff condition
Duration Interest
5months – 6months 2%
7months – 9months 3%
10 months – 12 months 4%
- Create method getTotalloan that accept values for amount loaned , interest and duration and contain compilation (amount loan*interest)*term
Create method getMonthlyPayment that receives value of total loan and duration , and will return the quotient of total loan/duration.
Make a class named Costumer w/ contain the main method
- Ask the user to input value for amount and duration and pass it into the constructor
Compute the interest , total loan , and monthly payment using method in loan class
use JoptionPane
Out put
[1] 1st constructor
[2] 2nd constructor
[3] 3rd constructor
Enter choice:
Amount loan:
Duration:
Interest:
Total loan:
Monthly Payment:
thank you !