#include #include #include void Input(float&, float&, float&, float&); void Print(float&, float&, float&, float&); void main() { float principal=0, low=0, high=0, years=0; Input (principal, low, high, years); Print (principal, low, high, years); } void Input(float &principal, float &low, float &high, float &years) { cout << "Enter the loan amount --> "; cin >> principal; cout << "Enter number of years for loan --> "; cin >> years; cout << "Enter low interest rate --> %"; cin >> low; cout << "Enter high interest rate --> %"; cin >> high; cout << "\n\n"; } void Print(float &principal, float &low, float &high, float &years) { double x,z,payment; cout << setprecision (2); cout << setiosflags (ios::fixed | ios::showpoint | ios::right); cout << "Time --> " << years << "\n"; cout << "Principal --> $" << principal << "\n"; cout << "Low rate --> " << low << "%" << "\n"; cout << "High rate --> " << high << "%" << "\n\n"; cout << "Annual Interest Rate"; cout << " Monthly Payment" << "\n\n"; years = years*12; while (low <= high) { x = (low/12)/100; z = pow(x+1,years); payment = (principal*x*z) / (z-1); cout << low << "%"; cout << " $" << payment << endl; low += 0.25; } }