writing if else code

I am trying to write the following code in Visual C++. Could someone check and see what I am typing in wrong?

#include <iostream>
using namespace std;

int main()
{
if (income <= 10000)
tax = income * 0.1;
else if (income <= 20000)
tax = 1000 +
(income - 10000) * 0.15;

return 0;
}

Thanks for your help!
L
You never declare any of your variables. The compiler doesn't know what 'income' or 'tax' are.

You also never get those values from anywhere. How is the computer supposed to know how much income there is? You never tell it.
Thanks Disch
Tip: post the compiler error's message.
Topic archived. No new replies allowed.