Question

In C. Thank you!

Bank


Write a program to calculate the monthly payment on a loan given the loan amount, interest rate and the number of years to pay off the loan. Then add a function to print an amortization schedule for that loan. Create a class to save the current balance and the rest of the data as private data. Add member functions to make a payment and to print the amortization report.



Use the following class header. Class Loan Data private: double Bal; double n; double i; double A; public: Loan Data (double
0 0
Add a comment Improve this question Transcribed image text
Answer #1

This the code of your problem. Constructor is not use in C programming.

class LoanData

{

private:

daouble Bal;

double n;

double i;

double A;

public:

LoanData{double p,double n,double i)

{

i=(i/(100*12));

n=n*2;

A=p*(i*(pow((1+i),n)))/(pow(1+i,n)-1);

Bal=p;

}

void MakePayment(double a);

void PrintAmortizationSchedule();

void PrintPayOffTimeReport();

}

void LoanData::MakePayment(double a)

{

Bal=Bal-a*A;

}

void LoanData::PrintAmortizationSchedule()

{

cout<<"Current Balance"<<Bal;

}

void main()

{

double p,n,i;

cout<<"Enter p";

cin>>p;

cout<<"Enter n"

cin>>n;

cout<<"Enter i";

cin>>i;

LoanData L(p,n,i);

L.MakePayment(n);

L.PrintAmortizationSchedule();

}

Note : If feel free to revert back if any thing you want to know.

thank u

Add a comment
Know the answer?
Add Answer to:
In C. Thank you! Bank Write a program to calculate the monthly payment on a loan...
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
  • C# Create an application that will allow a loan amount, interest rate, and number of finance...

    C# Create an application that will allow a loan amount, interest rate, and number of finance years to be entered for a given loan. Determine the monthly payment amount. Calculate how much interest will be paid over the life of the loan. Display an amortization schedule showing the new balance after each payment is made. Design an object-oriented solution. Use two classes. Loan class: characteristics such as the amount to be financed, rate of interest, period of time for the...

  • Write a C++ function that calculates the amortization schedule for a mortgage loan where the user...

    Write a C++ function that calculates the amortization schedule for a mortgage loan where the user makes one extra payment per year (in December). The function header is shown below. The sample files attached show the output. void output_extra_yearly(double loan_amount, double interest_rate, double term_years, double extra);

  • (C++) How do I develop a polymorphic banking program using an already existing Bank-Account hierarchy? For each account...

    (C++) How do I develop a polymorphic banking program using an already existing Bank-Account hierarchy? For each account in the vector, allow the user to specify an amount of money to withdraw from the Bank-Account using member function debit and an amount of money to deposit into the Bank-Account using member function credit. As you process each Bank-Account, determine its type. If a Bank-Account is a Savings, calculate the amount of interest owed to the Bank-Account using member function calculateInterest,...

  • C++ Could you check my code, it work but professor said that there are some mistakes(check...

    C++ Could you check my code, it work but professor said that there are some mistakes(check virtual functions, prin() and others, according assignment) . Assignment: My code: #include<iostream> #include<string> using namespace std; class BasicShape { //Abstract base class protected: double area; private:    string name; public: BasicShape(double a, string n) { area=a; name=n; } void virtual calcArea()=0;//Pure Virtual Function virtual void print() { cout<<"Area of "<<getName()<<" is: "<<area<<"\n"; } string getName(){    return name; } }; class Circle : public...

  • C++ Design a class bankAccount that defines a bank account as an ADT and implements the...

    C++ Design a class bankAccount that defines a bank account as an ADT and implements the basic properties of a bank account. The program will be an interactive, menu-driven program. a. Each object of the class bankAccount will hold the following information about an account: account holder’s name account number balance interest rate The data members MUST be private. Create an array of the bankAccount class that can hold up to 20 class objects. b. Include the member functions to...

  • The program is in python :) Write a code program to calculate the mortgage payment. The...

    The program is in python :) Write a code program to calculate the mortgage payment. The equation for calculating the mortgage payment is: M = P (1+r)n (1+r)n-1 Where: M is your monthly payment P is your principal r is your monthly interest rate, calculated by dividing your annual interest rate by 12. n is your number of payments (the number of months you will be paying the loan) Example: You have a $100,000 mortgage loan with 6 percent annual...

  • Your firm has taken out a $ 483,000 loan with 8.8 % APR​ (compounded monthly) for...

    Your firm has taken out a $ 483,000 loan with 8.8 % APR​ (compounded monthly) for some commercial property. As is common in commercial real​ estate, the loan is a 5​-year loan based on a 15​-year amortization. This means that your loan payments will be calculated as if you will take 15years to pay off the​ loan, but you actually must do so in 5years. To do​ this, you will make 59 equal payments based on the 15-year amortization schedule...

  • A. What would be your monthly mortgage payment if you pay for a $250,000

     4. A. What would be your monthly mortgage payment if you pay for a $250,000 home by making a 20% down payment and then take out a 3.74% thirty year fixed rate mortgage loan where interest is compounded monthly to cover the remaining balance. All work must be shown justifying the following answers. Mortgage payment = B. How much total interest would you have to pay over the entire life of the loan. Total interest paid = C. Suppose you inherit some money and...

  • 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...

  • 13. [Loan Amortization] You have just obtained a $300,000 mortgage loan from the Chase bank toward...

    13. [Loan Amortization] You have just obtained a $300,000 mortgage loan from the Chase bank toward the purchase of a home at 6% APR. The amortization schedule of your mortgage is set in the monthly payments for the next 30 years. A) What is the monthly loan payment?   B) What is the balance of the loan after 20 years of loan payments?     C) From the previous mortgage loan question, what will be the principal and the total interest that you...

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