I'm currently stuck on a homework problem. I have most of it down, but when my input hits the variable setting functions, it turns the input into garbage (even though they arent necessary, but I need them as part of the problem).
the problem is:
Design a class that will determine the monthly payment on a home mortgage. The monthly payment with interest compounded monthly can be calculated as follows:
Payment = (Loan * (Rate / 12) * Term) / Term - 1
Where
Term = (1 + Rate / 12) to the (12 * Years) power
Payment = the monthly payment
Loan = the dollar amount of the loan
Rate = the annual interest rate
Years = the number of years of the loan
The class should have member functions for setting loan, rate, and years. It should have getter functions for the monthly and total amount paid to the bank at the end of the loan period.
Input validation: Do not accept negative numbers.
here is what i have so far:
javascript:tx('code')
#include <iostream>
#include <cmath>
using namespace std;