You can't have code between the int main() and the first brace. All that code should be after the brace. Also, watch typos, (like missing underscores when typing variable names).
You can't have code between the int main() and the first brace. All that code should be after the brace. Also, watch typos, (like missing underscores when typing variable names).
You're also missing a semicolon here:
Code:cout<<"Anual Income = $" <<anual_income<<endl
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
No, that statement continues on the next line, so no semicolon is needed, although that's probably not the clearest way to do write it anyway.
Oops.
This
has several redundant expressions, marked in red. (That's what else statements do, you know. They only execute if the if was false.)Code:if (anual_income<=12000) tax_due=a; else if ((anual_income>12000) && (anual_income<=25000)) tax_due=(anual_income-12000)*b; else if (anual_income>25000) tax due=((anual_income-25000)*c)+d;
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.