income tax problem

closed account (37poizwU)
I"m having problem compiling this program.

Here is my coding : #include<iomanip>
#include<iostream>
using namespace std;

double readIn(double);
double tax(double);
void display(double);

int main ()

{
double income, tax;

do
{
double readIn (double)

cin >> income;
while(income < 0 )

{
cout<< " reenter income "<< income << endl;
cin >> income;
}

cout << " Enter income " << income << endl;
return double income;

}

double tax (double)
{
if (income = > 0&& income < = 2000)

{
cout<< " tax is 3 % of income " ;
cin >> tax;

}

else
{
cout << " tax is $60 + 4% ";
cin >> tax;

}

if ( income > 2000 && income <= 4000 )

{
cout << " tax is 60 + 4 % of the amount over $2,000";
cin>> tax;

}


else

{
cout << " tax is 140 + 5% of the amount over $4,000 " ;
cin >> tax;
}

if ( income > 4000 && income <= 6000)
{ cout << " tax is 140 + 5 % of the amount over $4,000 ";
cin>> tax;
}

else
{
cout << " tax is $240 + 6% of the amount over $6,000";
cin>> tax;
}

if ( income > 6000 && income <= 10000)

{
cout << "tax is $240 + 6 % of the amonut over $6,000";
cin>>tax;
}

else
{ tax>10000;
cout << " tax is $480 + 7 % of the amonut over $ 10,000 " ;
cin>> tax;
}

return double tax ;
}

display result ();


void displayresult(double)

{
cout << fixed << showpoint << setpercision (2);
cout << " INCOME" <<"\t" <<income << "TAX"<< "\t"<< tax << endl;

return 0 ;
}
return 0;
}

Can anyone input on what I should do or change in my coding in oder for this program to compile. Responds towards this matter will be greatly appreciated, thanks!
Do you expect the user to do the tax calculation? If not you need to include the calculation methods in the body of the tax function for all the various income brackets. .......and its >= not =>. Also wouldn`t be supprised if there are some { } mismatches......but Iwent cross-eyed before I got to the end. The moral of this story is to use code backets.
Topic archived. No new replies allowed.