My output is returning 0 for the value for the costs and I am not sure why.

```
#include <iostream>
#include <iomanip>
#include <cmath>
#define TAXRATE 0.0125
#define UTILITIES 300.00
#define INSURANCE 550.00
using namespace std;
// Function Prototypes
void getInput(double& sellPrice, double& interestRate, int& numYears);
void calcAll(double sellPrice, double interestRate, int numYears, double downPayment, double downPaymentRate, double loanAmount, double mortgage, double propertyTax, double insurance, double total);
double calcDownPayment(double sellPrice, double downPaymentRate);
double calcLoanAmount(double sellPrice, double downPayment);
double calcMortgage(double loanAmount, double interestRate, int numYears);
void output(double sellPrice, double interestRate, int numYears, double downPayment, double loanAmount, double mortgage, double propertyTax, double insurance, double total);
int main() {
// Non-global memory constant
const double downPaymentRate = 20.0;
// Declare variables
int numYears;
double sellPrice, interestRate, mortgage, total, propertyTax, insurance, loanTime, loanAmount, downPayment;
// Input the data from the user
getInput(sellPrice, interestRate, numYears);
// Calculate monthly cost
calcAll(sellPrice, interestRate, numYears, downPayment, downPaymentRate, loanAmount, mortgage, propertyTax, insurance, total);
// Output the cost
output(sellPrice, interestRate, numYears, downPayment, loanAmount, mortgage, propertyTax, insurance, total);
return 0;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void getInput(double& sellPrice, double& interestRate, int& numYears)
{
/* Pre: sellPrice - reference to the sell price of the house
interestRate - reference to the rate of interest per compounding period
numYears - reference to the number of years for the loan
Post: nothing
Purpose: Enter the data for sell price, interest rate, and duration of loan
*/
cout << "How much was the house sold for? ";
cin >> sellPrice;
cout << "What is the interest rate? ";
cin >> interestRate;
cout << "Enter the number of years for the loan: ";
cin >> numYears;
}
void calcAll(double sellPrice, double interestRate, int numYears, double downPayment, double downPaymentRate, double loanAmount, double mortgage, double propertyTax, double insurance, double total)
{
/* Pre: sellPrice - sell price of house
interestRate - interest rate
numYears - duration of loan
downPayment - down payment for house
downPaymentRate - down payment percentage cost for the house
loanAmount - amount that is loaned to user
mortgage - mortgage owed for house
propertyTax - property taxe owed for house
insurance - insurance owed for house
Post: nothing
Purpose: Calculate the amounts for each function
*/
downPayment = calcDownPayment(sellPrice, downPaymentRate);
loanAmount = calcLoanAmount(sellPrice, downPayment);
mortgage = calcMortgage(loanAmount, interestRate, numYears);
insurance = INSURANCE / 12.0;
propertyTax = (sellPrice * TAXRATE) / 12.0;
total = mortgage + UTILITIES + propertyTax + insurance;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
double calcDownPayment(double sellPrice, double downPaymentRate)
{
/* Pre: sellPrice - sell price of house
downPaymentRate - down payment percentage cost for the house
Post: down payment amount
Purpose: Calculate the down payment amount owed
*/
double monthlyDownPayment;
monthlyDownPayment = (sellPrice * downPaymentRate) / 12.0;
return monthlyDownPayment;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
double calcMortgage(double loanAmount, double interestRate, int numYears)
{
/* Pre: interestRate - rate of interest per compounding period
numYears - number of years for the loan
loanAmount - amount loaned for the house
Post: mortgage cost
Purpose: Calculate the mortgage cost
*/
// Declare variables
double loanTime = numYears * 12.0;
double loan = loanAmount;
double interest = (interestRate / 100.0) * 12.0;
double mortgage;
// Calculate mortgage
mortgage = ((loan * interest) * (pow(1.0 + interest, loanTime)))
/ (pow(1.0 + interest, loanTime) - 1.0);
return mortgage;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
double calcLoanAmount(double sellPrice, double downPayment)
{
/* Pre: sellPrice - sell price of house
downPayment - down payment cost of the house
Post: loan amount
Purpose: Calculate the loan amount
*/
double loanAmt;
loanAmt = sellPrice - downPayment;
return loanAmt;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void output(double sellPrice, double interestRate, int numYears, double downPayment, double loanAmount, double mortgage, double propertyTax, double insurance, double total)
{
/* Pre: sellPrice - sell price of house
interestRate - interest rate
numYears - duration of loan
downPayment - down payment for house
downPaymentRate - down payment percentage cost for the house
loanAmount - amount that is loaned to user
mortgage - mortgage owed for house
propertyTax - property taxe owed for house
insurance - insurance owed for house
Post: nothing
Purpose: Output the monthly cost
*/
cout << setprecision(2) << fixed;
cout << endl;
cout << "MONTHLY COST OF HOUSE " << endl << endl;
cout << "SELLING PRICE $ " << sellPrice << endl;
cout << "AMOUNT OF LOAN $ " << loanAmount << endl;
cout << setprecision(1) << fixed;
cout << "INTEREST RATE " << interestRate << "%" << endl;
cout << "TAX RATE " << TAXRATE << "%" << endl;
cout << "DURATION OF LOAN (YEARS) " << numYears << endl << endl;
cout << setprecision(2) << fixed;
cout << "MONTHLY PAYMENT " << endl;
cout << " MORTGAGE $ " << mortgage << endl;
cout << " UTILITIES $ " << UTILITIES << endl;
cout << " PROPERTY TAXES $ " << propertyTax << endl;
cout << " INSURANCE $ " << insurance << endl;
cout << " ___________" << endl;
cout << " $ " << total << endl;
}
```

Here is my output:

```
How much was the house sold for? 600000
What is the interest rate? 5
Enter the number of years for the loan: 20
MONTHLY COST OF HOUSE
SELLING PRICE $ 600000.00
AMOUNT OF LOAN $ 0.00
INTEREST RATE 5.0%
TAX RATE 0.0%
DURATION OF LOAN (YEARS) 20
MONTHLY PAYMENT
MORTGAGE $ 0.00
UTILITIES $ 300.00
PROPERTY TAXES $ 0.00
INSURANCE $ 0.00
___________
$ 0.00
```

If anyone could please provide information as to why my output doesn’t output the functions that I called, that would be very helpful!