For this c++ homework fill in the code Use functions and function declarations (headers) to calculate the payment schedule for a loan. Read from the user:    initialLoan, annualInterest, MonthlyPayment Create a loan payment function based on the 3 params above. For each month, print on one line, for each month#: Month,   Balance, Payment, PaidOnBalance,   Interest,        Total Int. Paid Until the monthbalance (currentBalance)<=0 At the end of every year (12 months), draw a line of 65 '$' characters. If the MonthlyPayment < 1st month's monthlyInterest, reject the payment code: #include <iostream>using namespace std; // make a header here for drawline // make a function called printLoanPayments that// takes in the loanAmount, annualInterest, and monthly payment// (each of the above are doubles) // print a header for multiple columns// convert annualInterest to monthly interest // keep updating the current balance// keep updating the total Interest paid// calculate the current month's 'interest accrued' (owed)// calculate the amount of the loan balance that is 'paid down'.// This is the amount that is paid toward the balance.// Note: monthly payment = AmountPaidTowardBalance + interestAccrued. // each month (starting at 1), print on a single line:// Month Balance Payment PaidOnBalance Interest and Total Int. Paid// until the Balance is 0 // Reject a monthly payment that is not able to cover at least the first// month's interest. // Remember to print so that dollars and cents are shown // Copy your drawLine function here int main(){   double loanAmount, annualInterest, monthlyPayment;   cout << "What is the loan amount? ";   cin >> loanAmount;   cout << "What is the annual interest? Type answer as a decimal (.1 for 10%, etc) ";   cin >> annualInterest;   cout << "What is the monthly payment? ";   cin >> monthlyPayment;    // add a call to printLoanPayments here     return 0;}

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 10SA: Why do you need to include function prototypes in a program that contains user-defined functions?...
icon
Related questions
Question

For this c++ homework fill in the code

Use functions and function declarations (headers) to calculate the payment schedule for a loan.

Read from the user:    initialLoan, annualInterest, MonthlyPayment

Create a loan payment function based on the 3 params above.

  • For each month, print on one line, for each month#:

Month,   Balance, Payment, PaidOnBalance,   Interest,        Total Int. Paid

Until the monthbalance (currentBalance)<=0

  • At the end of every year (12 months), draw a line of 65 '$' characters.
  • If the MonthlyPayment < 1st month's monthlyInterest, reject the payment

code:

#include <iostream>
using namespace std;

// make a header here for drawline

// make a function called printLoanPayments that
// takes in the loanAmount, annualInterest, and monthly payment
// (each of the above are doubles)

// print a header for multiple columns
// convert annualInterest to monthly interest

// keep updating the current balance
// keep updating the total Interest paid
// calculate the current month's 'interest accrued' (owed)
// calculate the amount of the loan balance that is 'paid down'.
// This is the amount that is paid toward the balance.
// Note: monthly payment = AmountPaidTowardBalance + interestAccrued.

// each month (starting at 1), print on a single line:
// Month Balance Payment PaidOnBalance Interest and Total Int. Paid
// until the Balance is 0

// Reject a monthly payment that is not able to cover at least the first
// month's interest.

// Remember to print so that dollars and cents are shown

// Copy your drawLine function here


int main()
{
   double loanAmount, annualInterest, monthlyPayment;
   cout << "What is the loan amount? ";
   cin >> loanAmount;
   cout << "What is the annual interest? Type answer as a decimal (.1 for 10%, etc) ";
   cin >> annualInterest;
   cout << "What is the monthly payment? ";
   cin >> monthlyPayment;

   // add a call to printLoanPayments here
  
   return 0;
}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

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