Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program to create a Mortgage class. Write the driver class separately. Mortgage class has a loan, a rate, and a term as

Write a Java program to create a Mortgage class. Write the driver class separately. Mortgage class has a loan, a rate, and a term as private data members.

Write constructors, get and set methods, and write a method to calculate the monthly payment and another method to display the results.

Create objects to test the program. Get the loan, rate, and term from a user and pass them to your constructor with three arguments. The user cannot enter any negative value for loan, rate, and term. The loan amount should be between 100, 000 and 2000,000 (Data Validation). Add version control and proper comments to your program.

Get the data from a user using scanner class.

(Sample data) Calculate the monthly payment for the amount = $200,000, the term = 30 years, and the interest rate = 4.5%. Your monthly payment should be about $1013.37.

Insert comments in the program to document the program.

For the Mortgage Calculator program, you can use the following formula:

monthlyPayment =( principal * rate) / ( 1.0 Math.pow(rate + 1, -term));

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

Explain the Neolithic age compared to the paleolithic age ?

Answered: 1 week ago

Question

What is loss of bone density and strength as ?

Answered: 1 week ago