PJ 2 is to write a C+ program to compute mortgage payment for a given loan amount, annual interest rate, and number of years for the loan. Please use the following code as the framework, and you must use your name as the author. Please reference textbook page 126 - 128 (Problem-Solving Case Study: Mortgage Payment Calculator) to get the computing algorithm and some ideas about this program. Your test case #1 output must look exactly as follows including the data. You must also do test case #2 and test case #3 with different sets of data. Each test case or test run must begin with a welcome message, and must end with a thank-you message.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter3: Input/output
Section: Chapter Questions
Problem 4PE: 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and...
icon
Related questions
Question

Here is the code I have so far. The areas with " // " are where i need help. Thank you

#include <iostream>
#include <iomanip>

using namespace std;
double loan_amount = 50000.00;
int number_of_years = 5 ;
double yearly_percent_int ;
double yearly_interest;
double monthly_interest;
int number_payments;

double getpayment(double apr)
{
double payment = 0.00 ;
yearly_percent_int = apr; // I need help with coding the payment computer here
return payment;
}

void print(double yearly_percent_int, double payment)
{
// need help here as well
}

int main()
int n = 1;
double apr1, apr2, apr3;
double pay1, pay2, pay3;
cout << "Welcome to the Mortgage Payment Tool of Dr. Simon Lin!" << endl << endl;
cout << n++ << "=====================================================." << endl << endl;
cout << ">> Enter 3 Annual % Interest Rate (such as 1.5 2.75 4.50):" << endl;
cin >> apr1 >> apr2 >> apr3 ;
cout << endl << n++ << "=====================================================." << endl;
pay1 = getpayment(apr1);
pay2 = getpayment(apr2);
pay3 = getpayment(apr3);
cout << endl;

//need help with printing two header lines here

print(apr1, pay1);
print(apr2, pay2);
print(apr3, pay3);
cout << endl;
cout << endl << n++ << "=====================================================." << endl;
cout << "Thank you for using the Mortgage Payment Tool of Dan!" << endl;
cout << n++ << "=====================================================." << endl<<endl;
cout << "To really quit the game, please enter a number: " << endl;
cin >> n ;
return 0;
}

PJ 2 is to write a C+ program to compute mortgage payment for a given loan amount, annual interest rate,
and number of years for the loan. Please use the following code as the framework, and you must use your
name as the author. Please reference textbook page 126 - 128 (Problem-Solving Case Study: Mortgage
Payment Calculator) to get the computing algorithm and some ideas about this program.
Your test case #1 output must look exactly as follows including the data.
You must also do test case #2 and test case #3 with different sets of data. Each test case or test run must
begin with a welcome message, and must end with a thank-you message.
Welcome to the Mortgage Payment Tool of Dr. Simon Lin !
E must use your name!
>> Enter 3 Annual % Interest Rate (such as 1.5 2.75 4.50):
1.5 2.75 4.50
2=
Loan Amount
Annual % Interest Rate
Number of Years
Monthly Payment
50000.00
1.50
5
$865.49
50000.00
2.75
5
$892.89
50000.00
4.50
5
$932.15
3=
Thank you for using the Mortgage Payment Tool of Dr. Simon Lin !
E must use your name!
4-
Transcribed Image Text:PJ 2 is to write a C+ program to compute mortgage payment for a given loan amount, annual interest rate, and number of years for the loan. Please use the following code as the framework, and you must use your name as the author. Please reference textbook page 126 - 128 (Problem-Solving Case Study: Mortgage Payment Calculator) to get the computing algorithm and some ideas about this program. Your test case #1 output must look exactly as follows including the data. You must also do test case #2 and test case #3 with different sets of data. Each test case or test run must begin with a welcome message, and must end with a thank-you message. Welcome to the Mortgage Payment Tool of Dr. Simon Lin ! E must use your name! >> Enter 3 Annual % Interest Rate (such as 1.5 2.75 4.50): 1.5 2.75 4.50 2= Loan Amount Annual % Interest Rate Number of Years Monthly Payment 50000.00 1.50 5 $865.49 50000.00 2.75 5 $892.89 50000.00 4.50 5 $932.15 3= Thank you for using the Mortgage Payment Tool of Dr. Simon Lin ! E must use your name! 4-
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Concept of memory addresses in pointers
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr