Question

C++ Program - Loan Payment Report Please write a C++ program to generate a detail loan payment report from the first month until the loan balance becomes zero or less than ten cents. You may use a whi...

C++ Program - Loan Payment Report

Please write a C++ program to generate a detail loan payment report from the first month until the loan balance becomes zero or less than ten cents.

You may use a while loop such as: while (loanBalance >= monthPayment) { … }.

When the loanBalance is less than the monthPayment, you need to compute the final payment amount, which should be the loanBalance plus its interest of one month.

For example, if your last-month’s loan balance is $47.12, which is less than the monthly payment of $50.00, then its final payment should be $47.83 because $47.12 plus its interest $0.71 (= 47.12 * 0.015) is $47.83.

Please make sure that your report is very user-friendly and easy to read.

Your report must first show the following headline: (for example)

Loan amount: _______       Annual Interest Rate: _______       Monthly Payment: _______

Your report must then have the following 5 columns for each month’s payment until the loan balance is equal to 0 or less than 0.10:

Month #                     // Start from 1 for first month, 2 for second month, and so on

Month-Payment        // Same for every month until the very last payment to pay off the loan balance

Interest-Paid             // current_loanBalance * Monthly_Interest_Rate

Debt-Paid                  // monthPayment - Interest_Paid

Loan-Balance            // Last_Month_loanBalance - Debt_Paid

Your report must have the following line at the end to show the total interest amount being paid:

Total Amount of Interest Paid:   $______________  

Your loan payment report layout must look as the following example:

Loan amount: $1000.00       Annual Interest Rate: 18.00%       Monthly Payment: $50.00

Month#           Month-Payment        Interest-Paid          Debt-Paid         Loan-Balance

----------            -------------------         ----------------        ---------------        -----------------

1                      $50.00                         $15.00                    $35.00                  $965.00

2                      $50.00                         $14.48                    $35.52                  $929.48

- -                    - - - - -                         - - - - -                     - - - - -                   - - - - - -          

21                   $50.00                         $2.86                      $47.14                  $143.53

22                    $50.00                         $2.15                     $47.85                  $95.68

23                    $50.00                         $1.44                      $48.56                  $47.12

24                    $47.83                         $0.71                     $47.12                  $0.00

Total Amount of Interest Paid:    $197.83     

======================================================================

        

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program

#include <iostream>
using namespace std;

int main()
{
   double monthlyPayment;
   double balance;
   double interestRate;
   double totalinterestPaid=0;
double Interest_Paid;
   int month = 1;


   cout.setf(ios::fixed);   // To print output in 2 decimal pts
   cout.setf(ios::showpoint);
   cout.precision(2);

   cout << "Enter the current balance of your loan: $";
   cin >> balance;
   cout << "Enter the interest rate : ";
   cin >> interestRate;
   cout << "Enter the desired monthly payment : $";
   cin >> monthlyPayment;

   cout<<"\nLoan amount: $"<<balance<<"\tAnnual Interest Rate: "<<interestRate<<"%"<<"\tMonthly Payment: $"<<monthlyPayment<<endl;
   cout<<"\nMonth# \tMonth-Payment\tInterest-Paid\tDebt-Paid\tLoan-Balance"<<endl;
cout<<"------ \t-------------\t-------------\t----------\t-----------"<<endl;


   while (interestRate >= 1) //Converts the interest rate to a decimal
   {
       interestRate = interestRate / 100;
   }


   while (balance > monthlyPayment)
   {
Interest_Paid=balance * interestRate/12;
totalinterestPaid+=Interest_Paid;
balance = balance * (1 + interestRate / 12) - monthlyPayment;
cout<<month<<"\t\t"<<monthlyPayment<<"\t\t"<<Interest_Paid<<"\t\t"<<monthlyPayment - Interest_Paid<<"\t\t"<<balance<<endl;
month = month+1;
}
   Interest_Paid=balance* interestRate/12;
   monthlyPayment=balance+Interest_Paid;
   balance= balance * (1 + interestRate / 12) - monthlyPayment;
   totalinterestPaid+=Interest_Paid;
cout<<month<<"\t\t"<<monthlyPayment<<"\t\t"<<Interest_Paid<<"\t\t"<<monthlyPayment - Interest_Paid<<"\t\t"<<balance<<endl;


cout << "\nTotal Amount of Interest Paid :$" << totalinterestPaid<< endl;

   return 0;
}



Output

nter the current balance of your loan: $1000 nter the interest rate18 nter the desired monthly payment $50 oan amount: $1000

Add a comment
Know the answer?
Add Answer to:
C++ Program - Loan Payment Report Please write a C++ program to generate a detail loan payment report from the first month until the loan balance becomes zero or less than ten cents. You may use a whi...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • When you borrow money to buy a house, a car, or for some other purpose, you...

    When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that...

  • Your program will ask the user to enter the amount of money they want to borrow,...

    Your program will ask the user to enter the amount of money they want to borrow, the interest rate, and the monthly payment amount. Your program will then determine how many months it will take to pay off that loan, what the final payment amount will be, and how much interest was paid over that time. If the monthly payment amount isn't high enough to pay off more than one month's interest, your program should notify the user what the...

  • answer those 4 please Fatima just borrowed 83,364 dollars. She plans to repay this loan by...

    answer those 4 please Fatima just borrowed 83,364 dollars. She plans to repay this loan by making a special payment of 29,387 dollars in 7 years and by making regular annual payments of 13,147 dollars per year until the loan is paid off. If the interest rate on the loan is 17.93 percent per year and she makes her first regular annual payment of 13,147 dollars immediately, then how many regular annual payments of 13,147 dollars must Fatima make? Round...

  • Use program control statements in the following exercises: Question 1 . Write pseudocode for the following:...

    Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...

  • PLEASE SHOW ALL WORK!! You have been engaged as a consultant to design a master budget...

    PLEASE SHOW ALL WORK!! You have been engaged as a consultant to design a master budget model and then to assist Helping Hand Corp. in making some management decisions based on that master budget. Helping Hand is a small, rapidly growing wholesaler of consumer electronic products. The company’s main product lines are small kitchen appliances and power tools. The marketing manager has recently completed a sales forecast. She believes the company’s sales will increase by 2 percent each month over...

  • Please show ALL work, including formulas used and equations for excel You have been engaged as...

    Please show ALL work, including formulas used and equations for excel You have been engaged as a consultant to design a master budget model and then to assist Helping Hand Corp. in making some management decisions based on that master budget. Helping Hand is a small, rapidly growing wholesaler of consumer electronic products. The company’s main product lines are small kitchen appliances and power tools. The marketing manager has recently completed a sales forecast. She believes the company’s sales will...

  • SHORT ANSWERS please USE THE FORMAT a - b - c - d 5-Which type of...

    SHORT ANSWERS please USE THE FORMAT a - b - c - d 5-Which type of annuity best describes the insurance premium that you have to pay at the beginning of each period? a. Annuity due b. Deferred annuity c. Ordinary annuity d. Annuity in arrears 6-Richard takes the opinion of his investment advisor to invest any excess savings that he has. His advisor told him about a new issue of AAA rated bonds. Richard decided to buy a total...

  • Payable: Use the t-accts below to record the following entries. If you get stuck, carefully revie...

    Payable: Use the t-accts below to record the following entries. If you get stuck, carefully review the online and text examples. On September 1t, Geo Inc. borrows $2,400 from State Bank and signs a 10 month short-term note payable. The interest rate on the note is 7%. Even though the note is only for 10 months, the interest rate is an annual rate (see interest calculations below). a) Record the entry to borrow the money from the bank. b) Next,...

  • Make journal entries for the following and assume transactions up to November 30 have been correctly...

    Make journal entries for the following and assume transactions up to November 30 have been correctly recorded!!! On February 3, 2017, FCM signed an agreement with Deion Sanders to provide media consulting for his football camp. On December 1, FCM completed some of the work for Sanders, and issued an invoice for $15,000. Full payment was received on January 15, 2018. Note: the project did not involve video production. On December 1, to prepare for expansion, FCM issued 1,000 shares...

  • how the cash here become 1135? because if you check my trial balance the cash is...

    how the cash here become 1135? because if you check my trial balance the cash is 8810. and i can I get help in step 8,9? and I provide u my journal entry this is the steps 8,9 From the information given above, I have solved 5,6,7 that is Adjusting entries, Trial Balance, Income Statement, Statement of Equity changes and Balance Sheet. Der in the problem Set Depreciation expense General in From 1. Sep 131, Dec formoh T unter est...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT