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

  • C++ Question Modify the class by changing private members to protected members and viewing Account class...

    C++ Question Modify the class by changing private members to protected members and viewing Account class as a base class. Define two derived classes Checking and RRSP. The Checking class has one additional private data: total(double). It has five public member functions: a constructor Checking (string n, string addr, double b, int p, double tot) (note you must call base constructor by using initialization list), double getTotal() to return total, void setTotal() to updata data, void withdraw(double w) which requires...

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

  • use the amortization formula (1) What monthly payment is needed to pay off a loan of...

    use the amortization formula (1) What monthly payment is needed to pay off a loan of $500 amortized at 12% compounded monthly for 2 years? (2) A couple has decided to purchase a $100,000 house using a down payment of $20,000. They can amortize the balance at 8% for 25 years. What is their monthly payment? (3) How long will it take to exhaust an IRA of $100,000 if you withdraw $2000 every month? Assume a rate of interest of...

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

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