Why is it outputing a weird number?

Thanks. Done
Last edited on
Hi,
Just add these lines in your function main() :
1
2
3
4
5
6
int main()
{
   cout.setf(ios::fixed);
   cout.precision(3);

   double selling_price...
Does that help you? :)
closed account (E0p9LyTq)
Those are not weird numbers, your variables in main are unintialized. Your two functions, inputData() and calculatePayment(), are using local variables. You are not passing the values back to main(). Change the parameter lists to use references:

1
2
3
//Prototype Functions
void inputData (double&, double&, int&);
void calculatePayment(double&, double&, double&, double&, double, int&); 


What is the selling price? :
10000
What is the rate of interest?:
15
What is the number of years in loan?:
20

Output Test:
Selling Price: 10000
Rate of Interest: 15
Number of Years: 20
Amount of Loan: 8000
Down Payment: 2000

Purpose: Monthly House Cost Calculation
Thank you!!
Good to hear :)
Topic archived. No new replies allowed.