I'm supposed to be writing a program for a mortgage calculator. I seem to be stuck and am quite frustrated. If someone could offer some advice that would be amazing. We are supposed to be sticking strictly to call-by-value and call-by-reference.

here is what I was so far

here is what I was so far

Code:

#include <iostream> void get_input(int& principle, double& annual_rate, int& length_years); //The program receives three inputs from operator void conversions (double& annual_rate, double& monthly_rate_decimal, int& length_years, int& length_months); //Converts annual interest rate to the monthly interest rate double monthly_payment (int& principle, double& monthly_rate_decimal, int& length_months, double monthly_payment); //Computes and prints the monthly payment void monthly_amounts; //Computes the remaining values in the amortization table void print_payment_table; //Prints values of monthly interest, principal payment and new principle balance void print_header; //Prints the header of the amortization table int main() { int (first_num, second_num, third_num); get_input (first_num, second_num, third_num); conversions (first_num, second_num); monthly_payment (first_num); monthly_amounts (first_num, second_num, third_num); print_payment_table; print_header; } { int prin; cout<<"Please enter the principal: "; cin>>prin; double rate; cout<<"Please enter the annual interest rate: "; cin>>rate; 1>=rate<=10; int years; cout<<"Please enter the length of the loan (in YEARS): "; cin>>years; }

*Last edited by shabbir; 29Sep2010 at 08:31.. Reason: Code blocks*