Instructions Design a class that will determine the monthly payment on a home mortgage.  The monthly payment with interest compounded monthly can be calculated as follows: (See image) The class should have member functions for setting the loan amount, interest rate, and number of years of the loan.  If should also have member functions for returning the monthly payment amount and the total amount paid to the bank at the end of the loan period.  Implement the class in a complete program as shown in the sample run below. You must have a comment block header at the top of your program.  You MUST use a class for the Mortgage.  You should have 3 files: Mortgage.h, Mortgage.cpp, project4.cpp like we did in class. You must have private/public members You must have a constructor that initializes all members to 0 You must have a mutator function for the loan amount, rate and years You must have accessor functions for the monthly payment and pay back amounts  You need a menu to ask for a new loan or exit the program You must use the correct data types for your variables You must validate your input.   The loan should be > 0 The interest rate should be >= 0 The length in years should be between 1 and 30 years Your main program should have 2 functions showPayment that takes one argument of type Mortgage as a pointer and displays the monthly payment and total payback getLoan that takes no arguments but returns one object of type Mortgate Your output should be formatted correctly   Sample Run #1: ------------------------ 1. Enter a new loan 2. Exit program Enter your choice: 1 Enter the amount of the loan: 250000 Enter the annual interest rate in decimal form (example .075): -1 Interest rate must be greater than 0. Please re-enter: .075 Enter the length of the loan in years: 50 Years must be greater than 0 and less than 30. Please re-enter: 30 ======================== Monthly Payment: $1748.04 Total Pay Back: $629293.06 ======================== ------------------------ 1. Enter a new loan 2. Exit program Enter your choice: 2

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter4: Financial Functions, Data Tables, And Amortization Schedules
Section: Chapter Questions
Problem 3EYW
icon
Related questions
Question
Instructions
Design a class that will determine the monthly payment on a home mortgage.  The monthly payment with interest compounded monthly can be calculated as follows: (See image)

The class should have member functions for setting the loan amount, interest rate, and number of years of the loan.  If should also have member functions for returning the monthly payment amount and the total amount paid to the bank at the end of the loan period.  Implement the class in a complete program as shown in the sample run below.

  • You must have a comment block header at the top of your program. 
  • You MUST use a class for the Mortgage.  You should have 3 files: Mortgage.h, Mortgage.cpp, project4.cpp like we did in class.
    • You must have private/public members
    • You must have a constructor that initializes all members to 0
    • You must have a mutator function for the loan amount, rate and years
    • You must have accessor functions for the monthly payment and pay back amounts 
  • You need a menu to ask for a new loan or exit the program
  • You must use the correct data types for your variables
  • You must validate your input.  
    • The loan should be > 0
    • The interest rate should be >= 0
    • The length in years should be between 1 and 30 years
  • Your main program should have 2 functions
    • showPayment that takes one argument of type Mortgage as a pointer and displays the monthly payment and total payback
    • getLoan that takes no arguments but returns one object of type Mortgate
  • Your output should be formatted correctly
 
Sample Run #1:
------------------------
1. Enter a new loan
2. Exit program
Enter your choice: 1
Enter the amount of the loan: 250000
Enter the annual interest rate in decimal form (example .075): -1
Interest rate must be greater than 0. Please re-enter: .075
Enter the length of the loan in years: 50
Years must be greater than 0 and less than 30. Please re-enter: 30
========================
Monthly Payment: $1748.04
Total Pay Back: $629293.06
========================
------------------------
1. Enter a new loan
2. Exit program
Enter your choice: 2
Rate
12
Term 1
Loan X
Payment
Where
Term = (1 +
x Term
Rate 12 x Years
-)
12
Payment = the monthly payment
Loan = the dollar amount of the loan
Rate = the annual interest rate
Years = the number of years of the loan
Transcribed Image Text:Rate 12 Term 1 Loan X Payment Where Term = (1 + x Term Rate 12 x Years -) 12 Payment = the monthly payment Loan = the dollar amount of the loan Rate = the annual interest rate Years = the number of years of the loan
Expert Solution
steps

Step by step

Solved in 5 steps with 5 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole