monthly mortgage payment

Am having issues with the code below. No value is returned when the application is ran.Please help

#include <iostream>
#include <cmath>
using std::cout; using std::cin; using std::endl; using std::pow;


class Loan
{
protected:

double LoanAmounts;
double Yearlyinterst;
int PayOffYears;
Loan()
: LoanAmounts(0)
, Yearlyinterst(0)
, PayOffYears(0)
{
}

public:

void setLoanAmounts(double l) { LoanAmounts = l; }
void setYearlydoubleerest(double r) { Yearlyinterst = r; }
void setPayOffYears(int y) { PayOffYears = y; }
double getMonthlyDue(double term) { return (LoanAmounts * (Yearlyinterst / 12) * term) / (term - 1);}
double getTotalDue(double term) { return (getMonthlyDue(term) * PayOffYears); }



};

class MortgageCal : public Loan
{
public:
MortgageCal() : Loan(){}


};

int main()
{

MortgageCal CalFinal;
double Loan, doubleerest,term;
int Years;


cout << "Please provide Loan Amount: " << endl;
cin >> Loan;
CalFinal.setLoanAmounts(Loan);

cout << "Please provide yearly doubleerest rate: " << endl;
cin >> doubleerest;
CalFinal.setYearlydoubleerest(doubleerest);

cout << "Please provide amount of years the loan will be paid of: " << endl;
cin >> Years;
CalFinal.setPayOffYears(Years);

term= pow((1 + doubleerest / 12),( 12 * Years));


cout << "Monthly payment is " << CalFinal.getMonthlyDue(term) << endl;



}
1) Please use code tags when posting code, to make it readable:

http://www.cplusplus.com/articles/z13hAqkS/

2)
No value is returned


What do you mean by this? Do you mean that no value is displayed in the console when you run it? Or is one of your functions failing to return a value to the calling code? Or is the entire program failing to return a value to the operating system?
Topic archived. No new replies allowed.