Question: Create a class called Loan that represents a simple bank loan. It should include private members for the loan amount ( principal ) , the
Create a class called "Loan" that represents a simple bank loan.
It should include private members for the loan amount principal the loan term integer in months and the interest rate a floating point number
It should have a constructor for this information and accessors and mutators as well.
All of these members and constructors should prevent nonpositive values and give an error message if the class hasn't been properly initialized.
It should be able to calculate the monthly payment based on this formula: Payment where is the interest rate, is the loan amount, and is the number of months of the loan. Return this in a member function.
Sum up all of the monthly payments to compute the entire cost of the loan in another member function interest principal
Subtract the total cost of the loan from the principal for just the interest cost of the loan. Return this in another member function.
Use this class on an example car loan for $ over years at Remember to convert years to months or have a member function do that for you eg setloanlengthfromyears
Also use this class on an example home loan of $ over years at and at and note the difference in costs.
Please help with that Assigment for C Code that Im gonna run it in Visual studio.
Subject: Advance Programing Technique.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
