implement the class Loan with the following requirements:
•
A member variable that will hold the annual interest rate of the loan. Its default value will be 2.5.
•
A member variable that will hold the number of years for the loan. Its default value will be 1.
•
A member variable that will hold the loan amount. Its default variable will be 1000.
•
A default constructor.
•
Another constructor that has interest rate, years, and loan amount as its parameters.
•
A member function that returns the annual interest rate of this loan.
•
A member function that returns the number of the years of this loan.
•
A member function that returns the amount of this loan.
•
A member function that sets a new annual interest rate to this loan.
•
A member function that sets a new number of years to this loan.
•
A member function that sets a new amount to this loan.
•
A member function that returns the monthly payment of this loan
Comments
Leave a comment