Question

C++. Need help

Amortization Write a function that produces an amortization schedule. This is a schedule of payments on a loan. For example s

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

#include<iostream>
#include<iomanip>

using namespace std;

void calculate(double pri, double rt, double pay)
{
   double monthrt = rt/12;
   monthrt = monthrt/100;
   double interest, priPaid, endPay, tInt=0.0;
  
   // setw is used to set width of the output, if setw is 15, then the string will occupy 15 spaces and the extra spaces are provided from right
  
   cout<<"\n\nPrinciple"<<setw(15)<<"Int. Paid"<<setw(15)<<"Principle Paid"<<setw(20)<<"Ending payment"<<setw(20)<<"Payment Balance\n";
  
   while(pri > 0)
   {
       interest = monthrt*pri;
       priPaid = pay - interest;
      
       if(priPaid > pri)
           priPaid = pri;
      
       if(pri >= pay)
           endPay = pay;
       else
           endPay = pri;
          
      
       cout<<setprecision(2)<<pri<<setw(20)<<setprecision(2)<<interest<<setw(15)<<setprecision(2)<<priPaid<<setw(20)<<setprecision(2)<<endPay<<setw(20)<<setprecision(2)<<pri-priPaid<<endl;
      
       tInt += interest;
      
       pri = pri - priPaid;
   }
   cout<<"\nTotal interest paid: "<<tInt;
}

int main()
{
   double principle, rate, payment;
  
   cout<<"Principle:\t$";
   cin>>principle;
  
   cout<<"Rate:\t\t";
   cin>>rate;
  
   cout<<"Payment:\t$";
   cin>>payment;
  
   calculate(principle, rate, payment);
  
   return 0;
}

CAUsersluser Documents\DS File 25apr.exe Principle Rate 12 10.00 $2 Payment: Principle Int. Paid Principle Paid Ending paymen

Add a comment
Know the answer?
Add Answer to:
C++. Need help Amortization Write a function that produces an amortization schedule. This is a schedule...
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
  • Mortgage Amortization Complete the loan amortization schedule for a Mortgage that will be repaid over 360...

    Mortgage Amortization Complete the loan amortization schedule for a Mortgage that will be repaid over 360 months and answer the following questions (The details about the loan are shown below): Correct Answers 1. What is your monthly payment? 2. What is the total $ amount of payments made over the life of the loan Enter Answers Here. 3. How many months will it take to pay off the loan if you pay an extra $465.71 per month? Note: Enter the...

  • i need part B and the rest on excel Question 1 Prepare the amortization schedule for...

    i need part B and the rest on excel Question 1 Prepare the amortization schedule for a thirty-year loan of $100,000. The APR is 3% and the loan calls for equal monthly payments. The following table shows how you should prepare the amortization schedule for the loan. a. Interest Principal Ending Month lPayment Payment Payment Balance Beginning ota S100,000.00 b. Use the annuity formula to find how much principal you still owe to the bank at the end of the...

  • Amortization schedules a. Set up an amortization schedule for a $250,000 mortgage to be repaid in...

    Amortization schedules a. Set up an amortization schedule for a $250,000 mortgage to be repaid in equal monthly installments at the end of each month for the next 15 years. The mortgage rate is an APR of 5%. b. How large must each monthly payment be if the loan is for $500,000? Assume that the interest rate remains at 5% and that the loan is paid off over 15 years. c. How large must each monthly payment be if the...

  • Amortization schedules a. Set up an amortization schedule for a $250,000 mortgage to be repaid in...

    Amortization schedules a. Set up an amortization schedule for a $250,000 mortgage to be repaid in equal monthly installments at the end of each month for the next 15 years. The mortgage rate is an APR of 4.5%. b. How large must each monthly payment be if the loan is for $500,000? Assume that the interest rate remains at 4.5% and that the loan is paid off over 15 years. c. How large must each monthly payment be if the...

  • Spreadsheet 1: Amortization Table Create an amortization table in MS-Excel in the format shown below: Scenario:...

    Spreadsheet 1: Amortization Table Create an amortization table in MS-Excel in the format shown below: Scenario: 2 years ago Janice got a $100,000, 15-year mortgage with an annual interest rate of 6% and monthly payments. 1) What is her monthly payment? 2) How much does she owe today (after 24 payments)? 3) How much will she owe in 3 years (after 60 payments)? 4) How much will she owe in 3 years (after 60 payments) if she makes an extra...

  • The purpose of this question is to give you experience creating an amortization schedule for a...

    The purpose of this question is to give you experience creating an amortization schedule for a loan. As noted by Investopedia: ‘An amortization schedule is a complete table of periodic loan payments, showing the amount of principal and the amount of interest that comprise each payment until the loan is paid off at the end of its term. While each periodic payment is the same amount early in the schedule, the majority of each payment is interest; later in the...

  • b. Fill in the partial amortization schedule for the loan, rounding your answers to two decimal...

    b. Fill in the partial amortization schedule for the loan, rounding your answers to two decimal places. Holly received a loan of $36,000 at 3.5% compounded monthly. She had to make payments at the end of every month for a period of 5 years to settle the loan. a. Calculate the size of payments. 0.00 Round to the nearest cent Interest Principal Payment Principal Payment Portion Portion Balance Number $36,000.00 $0.00 $0.00 $0.00 $0.00 1 $0.00 $0.00 $0.00 $0.00 2...

  • Amortization Schedule

    Create an amortization schedule using the following   assumptions: Purchase Price$280,000Down Payment5%Loan Amount266000Interest Rate 11%Loan Term30 Year - FixedBalance @End of Year 5Amortization to be in months. (month 60)

  • I would like help with using the excel PMT function to answer this question. I know...

    I would like help with using the excel PMT function to answer this question. I know how to find monthly/total payments but I do not know how to find "amount paid towards principle after 29 months with 6.7% nominal interest and 360standard month payment schedule" I would like to know the excel steps thank you

  • Given the annual interest rate and a line of an amortization schedule for that loan, complete...

    Given the annual interest rate and a line of an amortization schedule for that loan, complete the next line of the schedule. Assume that payments are made monthly. Annual Interest Rate Payment $524.49 Interest Paid $43.29 Paid on Principal $481.20 Balance $8,040.03 out the amortization schedule below. Payment Balance Annual interest Rate 6.1% Interest Paid $43.29 Paid on Principal $481.20 $8.040.03 $524.49 $ 524.49 Round to the nearest cent as needed.

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