Question

In: Computer Science

Use coding langues C ++ The monthly payment on a loan may be calculated by the...

Use coding langues C ++

The monthly payment on a loan may be calculated by the following formula:

Payment = Rate × ( 1 + Rate ) N/ ( ( 1 + Rate ) N − 1 )

Rate is the monthly interest rate, which is the annual interest rate divided by 12. (12 percent annual interest would be 1 percent monthly interest.) N is the number of payments, and L is the amount of the loan. Write a program that will ask the user to enter these value and then displays a report that shows:

  • Loan Amount
  • Monthly Interest Rate
  • Number of Payments
  • Monthly Payments
  • Amount Paidback
  • Interest Paid

Format your dollar amount in fixed-point notation, with two decimal places of precision.

Solutions

Expert Solution

// PLEASE LIKE THE SOLUTION
// FEEL FREE TO DISCUSS IN COMMENT SECTION
// C++ PROGRAM

#include<bits/stdc++.h>
using namespace std;

// main function
int main(){
  
   // loan amount
   double loanAmount;
   double rate;
   int N;   // number of payments

   // ask user for details
   cout<<"Enter the loan amount: ";
   cin>>loanAmount;

   cout<<"Enter the rate in %: ";
   cin>>rate;
   rate = rate/100;

   cout<<"Enter number of Payments: ";
   cin>>N;

   // variables
   double monthlyPayment;
   double AmountPaid;
  
   //
   monthlyPayment = ((rate*(pow(rate+1,N)))/((pow(rate+1,N))-1))*loanAmount;

   // amount paid back
   AmountPaid = monthlyPayment*N;


   // print by proper formatting
   cout << "Loan amount            $" <<setprecision(2)<<fixed<<loanAmount<<endl;

   cout<<"Monthly Interest Rate   "<<rate*100 <<"%"<<endl;
   cout << "Number of Payments      "<< N << endl;
   cout << "Monthly Payment        $" <<setprecision(2)<<monthlyPayment<<endl;
   cout << "Amount Paid Back       $" <<setprecision(2)<<AmountPaid<<endl;
   cout << "Interest Paid          $" <<setprecision(2)<<(AmountPaid-loanAmount)<<endl;

   return 0;
}

// SAMPLE OUTPUT


Related Solutions

The monthly payment on a loan may be calculated by the following formula: Payment =    Rate *...
The monthly payment on a loan may be calculated by the following formula: Payment =    Rate * (1 + Rate)N ((1 + Rate)N -1) Rate is the monthly interest rate, which is the annual interest rate divided by 12. (12 percent annual interest would be 1 percent monthly interest.) N is the number of payments, and L is the amount of the loan. Write a program that asks for these (Input) values then displays a report similar to: Loan Amount:            $...
Compute the monthly payment for a $133,440 home loan. The stated interest of the loan is...
Compute the monthly payment for a $133,440 home loan. The stated interest of the loan is 5% with monthly payments. The loan amortization is over 25 years.
Please use the data to answer the following question: Compute the total loan amount, monthly payment,...
Please use the data to answer the following question: Compute the total loan amount, monthly payment, and total interest payment for different down payment amount. Plot payment and total interest, and discuss how they change with respect to down payment amount. Auto Loan Payment Calculator Inputs Auto Loan Amount $20,000 Annual Interest Rate 8.50% Term of Loan in Years 3 First Payment Date 2/1/18 Last Payment Date 1/1/21 Frequency of Payment Monthly Summary Number of Payments 36 Rate (per period)...
Suppose you are offered a bullet loan. The payments are made monthly and they are calculated...
Suppose you are offered a bullet loan. The payments are made monthly and they are calculated using a 30-year traditional mortgage. So, you have 5-year bullet. In this situation, you will make the payments for the 30-year traditional mortgage in the first 5 years, but the bullet payment is due after you make the 60th payment. Note that the bullet payment is the remaining principal of the loan which can calculated using amortization table, however, in addition, it is the...
What will be the monthly payment on a loan of $602, amortizedover 29 years ,...
What will be the monthly payment on a loan of $602, amortized over 29 years , at an annual interest rate of 9%
Calculate the table factor, the finance charge, and the monthly payment (in $) for the loan...
Calculate the table factor, the finance charge, and the monthly payment (in $) for the loan by using the APR table, Table 13-1. (Round your answers to the nearest cent.) Amount Financed Number of Payments APR Table Factor Finance Charge Monthly Payment $9,400 36 13% $ $ $
An loan is paid in 3 years with monthly payment starting one month after the loan...
An loan is paid in 3 years with monthly payment starting one month after the loan is made. The payments are 540 each in the first year, and 900 per month in the second year, and 700 each in the last year. Interest is at a nominal rate of 7.8 percent convertible monthly. What is the outstanding balance after the 15th payment. Keep 4 decimal places only.
Using the ENGR 315 Automobile Loan Payment Calculator posted, calculate the monthly payment required for a...
Using the ENGR 315 Automobile Loan Payment Calculator posted, calculate the monthly payment required for a 60-month new automobile loan made by the lender at 4.74% annual percentage rate (APR) if the car buyer borrowed $35,742. Save the resulting Excel spreadsheet file, as a PDF, presenting your payment calculations
      4. Calculate the new monthly payment given a $150,000 loan for 6%, 30 years (monthly)...
      4. Calculate the new monthly payment given a $150,000 loan for 6%, 30 years (monthly) with a lump-sum pay down of $20,000 made after 12 years have lapsed. New MP: Calculate the upfront fees that needs to be charged by the lender given a loan for $150,000 with terms 6%, 30 years (monthly compounding). The lender wants to earn a 6.6% yield. Assume a holding period of 12 years. Calculate the total payments and total interest expense for a...
1. What would be the monthly payment on a 5 year loan of $35,000 if the...
1. What would be the monthly payment on a 5 year loan of $35,000 if the interest rate is 6.0% compounded monthly? 2. Sarah bought a raft for $664 using her credit card. The interst rate is 0.186 compounded monthly. If she pays $23 a month, how long will it take her to pay off the credit card? 3. What would be the monthly payment on a 5 year loan of $24,000 if the interest rate is 5.0% compounded monthly?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT