Question: Write a program to calculate monthly mortgage payments. Learning Objectives: Write class, create objects using constructors, and write methods. Write a program to calculate monthly
Write a program to calculate monthly mortgage payments. Learning Objectives:
Write class, create objects using constructors, and write methods.
Write a program to calculate monthly mortgage payments.
Create two classes Mortgage.java and MortgageCalculation.java points each
The Mortgage.java class will be your blueprint where you will create:
A constructor with three parameters Mortgage amount, mortgage interest rate yearly
rate and mortgage term in years points
A method to calculate monthly mortgage amount points
The formula to use is this:
Where monthly mortgage payment amount this is what you are calculating to get
Principal mortgage amount
number of months required to repay the loan
monthly rate Mortgage interest
means raise to the power of n
This method should return monthly mortgage amount.
Write a method that will return the principal balance after payment of one installment.
In that installment payment, of the amount was attributed to interest and was
attributed to the principal. points The mortgage company allows early principal payment. Write a method for extra
principal payment that will return the principal balance after this payment. points
Write a setter method for the interest rate. points
Write a getter method for the principal balance. points
On the driver class, create objects of type Mortgage points:
A mortgage of $ with fixed yearly mortgage rate of for years
A mortgage of $ with fixed yearly mortgage rate of for years.
Print monthly mortgage amount for both loans. points
Print principal balance after one installment is paid points
Set new interest rate by lowering both rates by basis points and print monthly
mortgage rate for both loans. points
Make extra principal payment for $ for both loans and print what will be the
monthly mortgage payment after making that extra principal payment. points
Print the current principal balance. points
Please write the methods in sequence and the same for operations.
Your solutions will be in two files. Copy and paste your code as instructed below and
submit this word document through Canvas.
Answer:
Mortgage.java:
Create two classes Mortgage.java and MortgageCalculation.java
The Mortgage.java class will be your blueprint where you will create:
A constructor with three parameters Mortgage amount, mortgage interest rate yearly
rate and mortgage term in years
A method to calculate monthly mortgage amount
The formula to use is this:
M Pmonthly ratemonthly ratenmonthly raten
Where M monthly mortgage payment amount this is what you are calculating to get
P Principal mortgage amount
n number of months required to repay the loan
monthly rate Mortgage interest
n means raise to the power of n
This method should return monthly mortgage amount.
Write a method that will return the principal balance after payment of one installment.
In that installment payment, of the amount was attributed to interest and was
attributed to the principal.
The mortgage company allows early principal payment. Write a method for extra
principal payment that will return the principal balance after this payment.
Write a setter method for the interest rate.
Write a getter method for the principal balance.
On the driver class, create objects of type Mortgage
A mortgage of $ with fixed yearly mortgage rate of for years
A mortgage of $ with fixed yearly mortgage rate of for years.
Print monthly mortgage amount for both loans.
Print principal balance after one installment is paid
Set new interest rate by lowering both rates by basis points and print monthly
mortgage rate for both loans.
Make extra principal payment for $ for both loans and print what will be the
monthly mortgage payment after making that extra principal payment.
Print the current principal balance.
Please write the methods in sequence and the same for operations.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
