THE PROGRAM DOES NOT WORK
[code]
#include <iostream>
#include <string>
using namespace std;
double annualIncome();
void calculations(double annualIncome);
int main()
{
annualIncome();
calculations(double annualIncome); >>>>>>>> SOMETHING WRONG IN HERE?
return 0;
}
double annualIncome()
{
double annualIncome =0;
cout << "How much money do you wanna make a year?" << endl;
cin >> annualIncome;
return annualIncome;
}
void calculations(double annualIncome)
{
cout << annualIncome << endl;
}
while it is legal to have the same name used all over, it is confusing to read.
you probably meant
double AI = annualincome();
calculations(AI);
where you have
annualIncome();
calculations(double annualIncome);
or possibly
calculations(annualincome());
Last edited on