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. 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. In main(), using the monthly payment that you just calculated, call a function to create an amortization schedule for the loan using these specifications:  Create a function called Amortize.  It should receive as parameters: currentPeriod, totalPeriods, paymentAmount, monthlyInterestRate, currentBalance. 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::max(),'\n');                       cin >> num; } this is how the output should be: (the output should be ONLY principal, rate and number of years . THe rest and Monthly payment should be calculated automatically by the program)

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: (the output should be ONLY principal, rate and number of years . THe rest and Monthly payment should be calculated automatically by the program)
### Loan Amortization Schedule Explanation

This is a sample loan amortization schedule displaying how a loan of $100,000 is paid off over 15 years with a fixed annual interest rate of 4.5%. The monthly payment for this loan is $764.99.

#### Loan Details:
- **Principal**: $100,000
- **Life of Loan**: 15 years
- **Annual Interest Rate**: 4.5%
- **Monthly Payment**: $764.99

#### Amortization Schedule:
This schedule outlines each payment made throughout the loan term. For each payment, it specifies the amount allocated towards interest and principal, as well as the remaining balance.

- **Payment Columns**:
  - **Payment Number**: Sequential number for each payment.
  - **Amount**: Total amount paid monthly, which is $764.99 for this loan.
  - **Interest**: Portion of the payment that goes towards paying the interest.
  - **Principal**: Portion of the payment that goes towards paying off the loan principal.
  - **Balance**: Remaining balance of the loan after each payment.

#### Example Payments:
1. **Payment 1**:
   - **Amount**: $764.99
   - **Interest**: $375.00
   - **Principal**: $389.99
   - **Balance**: $100,000.00 

2. **Payment 2**:
   - **Amount**: $764.99
   - **Interest**: $373.54
   - **Principal**: $391.46
   - **Balance**: $99,610.01

3. **Payment 3**:
   - **Amount**: $764.99
   - **Interest**: $372.07
   - **Principal**: $392.92
   - **Balance**: $99,218.55

...

- **Payment 178**:
  - **Interest**: $8.54
  - **Principal**: $756.45
  - **Balance**: $1,521.42

- **Payment 179**:
  - **Interest**: $5.71
  - **Principal**: $759.29
  - **Balance**: $762.14

- **Payment 180**:
  - **Interest**: $2.86
Transcribed Image Text:### Loan Amortization Schedule Explanation This is a sample loan amortization schedule displaying how a loan of $100,000 is paid off over 15 years with a fixed annual interest rate of 4.5%. The monthly payment for this loan is $764.99. #### Loan Details: - **Principal**: $100,000 - **Life of Loan**: 15 years - **Annual Interest Rate**: 4.5% - **Monthly Payment**: $764.99 #### Amortization Schedule: This schedule outlines each payment made throughout the loan term. For each payment, it specifies the amount allocated towards interest and principal, as well as the remaining balance. - **Payment Columns**: - **Payment Number**: Sequential number for each payment. - **Amount**: Total amount paid monthly, which is $764.99 for this loan. - **Interest**: Portion of the payment that goes towards paying the interest. - **Principal**: Portion of the payment that goes towards paying off the loan principal. - **Balance**: Remaining balance of the loan after each payment. #### Example Payments: 1. **Payment 1**: - **Amount**: $764.99 - **Interest**: $375.00 - **Principal**: $389.99 - **Balance**: $100,000.00 2. **Payment 2**: - **Amount**: $764.99 - **Interest**: $373.54 - **Principal**: $391.46 - **Balance**: $99,610.01 3. **Payment 3**: - **Amount**: $764.99 - **Interest**: $372.07 - **Principal**: $392.92 - **Balance**: $99,218.55 ... - **Payment 178**: - **Interest**: $8.54 - **Principal**: $756.45 - **Balance**: $1,521.42 - **Payment 179**: - **Interest**: $5.71 - **Principal**: $759.29 - **Balance**: $762.14 - **Payment 180**: - **Interest**: $2.86
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Mathematical functions
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
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