Inputs of mortgage calculator that determines a monthly payment for loans and produces an amortization schedule for the life of the loan(10-15-20) years fixed loan with 4.5% interest rate and Principal 100000$.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Inputs of mortgage calculator that determines a monthly payment for loans and produces an amortization schedule for the life of the loan(10-15-20) years fixed loan with 4.5% interest rate and Principal 100000$.

The program should initially prompt the user for

1) the principal of the loan. 2)It should then ask him or her to enter an annual interest rate for the loan. 3)The final input should be the number of years that the loan will be outstanding.  Because the company only offers three different terms (10-, 15-, and 30-year loans), the program should ensure that no other terms are entered.

P = $100,000
r = 4.50% per year / 12 months = 0.375% (or 0.00375) per period
n = 15 years * 12 months = 180 total periods

A = 100,000 * (.00375 * (1 + .00375)180)/((1+.00375)180 – 1)

Using these numbers in the formula above yields a monthly payment of $764.99.

Amortization schedule:

The Interest portion of the payment is calculated as the rate (r) times the previous balance and should be rounded to the nearest cent. The Principal portion of the payment is calculated as Amount - Interest. The new Balance is calculated by subtracting the Principal from the previous balance. The last payment amount may need to be adjusted (as in the table below) to account for the rounding.

The amortization schedule for the example above is presented here: Note that the first and last three rows are listed here so that you can see the beginning and end of the report. In your program, you must include all of the rows in your output.

  1. Once the inputs have been entered and validated, your program must calculate the monthly payment for the loan.  you must create a function called CalcPayment that receives the principal, interest rate, and number of years as parameters.  The function should return the monthly payment that is calculated.
  2. In main(), using the monthly payment that you just calculated, call a function to create an amortization schedule for the loan using these specifications: 
    1. Create a function called Amortize.  It should receive as parameters: currentPeriod, totalPeriods, paymentAmount, monthlyInterestRate, currentBalance.
    2. Your program should check for invalid data such as non-numeric and non-positive entries for principal, interest rate, and term.

      Therefore, you may use the following code to determine if a non-numeric or negative number has been entered:

             int num;

             cout << "Enter an integer: " << endl;

             cin >> num;

             while (cin.fail() || num < 0)

                    {

      cout << "You must enter a number, and that number must be positive.  Please try again. " << endl;

                            cin.clear();

                            cin.ignore(numeric_limits<streamsize>::max(),'\n');

                            cin >> num; }

      this is how the output should be:
Loan Application - Amortization Schedule
Principal:
Life of Loan (10, 15 or 30 years):
Annual interest rate:
Monthly payment:
100000
15
4.5%
764.99
Payment Amount Interest Principal
Balance
100000.00
1 764.99
375.00
389.99
99610.01
2
764.99
373.54
391.46
99218.55
3
764.99
372.07
392.92
98825.63
178
764.99
8.54
756.45
1521.42
179
764.99
5.71
759.29
762.14
180
764.99
2.86
762.14
e.00
Press any key to continue .
Transcribed Image Text:Loan Application - Amortization Schedule Principal: Life of Loan (10, 15 or 30 years): Annual interest rate: Monthly payment: 100000 15 4.5% 764.99 Payment Amount Interest Principal Balance 100000.00 1 764.99 375.00 389.99 99610.01 2 764.99 373.54 391.46 99218.55 3 764.99 372.07 392.92 98825.63 178 764.99 8.54 756.45 1521.42 179 764.99 5.71 759.29 762.14 180 764.99 2.86 762.14 e.00 Press any key to continue .
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 5 images

Blurred answer
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education