every time i build it fails? What am I doing wrong

closed account (zCR4E3v7)
//Zipoids is a level of currency used by obscure gamers. These gamers must pay tax in the following manner 1. 0 - 5,000 zipoids – 0% tax 2. 5001 - 10,000 zipoids – 10% tax 3. 10,001 – 20,000 zipoid – 15% tax 4. Above 20,000 zipoids 20% tax. Write a program that will get the amount of Zipoids earned and will compute the tax. Your program should output the tax and the adjusted pay after the tax. You should use a ladder style if /else to compute this. Do not put cin or cout inside the if logic. Only compute the tax.//



#include <iostream>
#include <iomanip>

using namespace std;

int main ()
{
double ziploids;
int tax;

cout << " Enter amount of Ziploids earned" << endl;
cin >> ziploids;

if (ziploids <= 5000)
{
tax = ziploids * 0;
cout << " Your tax is " << tax << endl;
}
else if(ziploids >= 5001 && <= 10000)
{
tax = ziploids * .10;
cout << "Your tax is " << tax << endl;
}
else if(ziploids >= 10001 && <= 20000)
{
tax = ziploids * .15;
cout << " Your tax is " << tax << endl;
}
else if (ziploids > 20001)
{
tax = ziploids * .20;
cout << " Your tax is " << tax << endl;
return 0;
}
First, please use code tags when posting code. See http://www.cplusplus.com/articles/jEywvCM9/


"it" fails. What is the "it" and how does it fail?
If compiler finds a problem, then the compiler shows an error message that explains what the compiler sees as a problem. That is vital information.


What you are doing wrong?
It looks like you don't pay enough attention to the details.
You're missing a brace at the end somewhere. This is why code formatting is so very important.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <iomanip>

using namespace std;

int main ()
{
	double ziploids;
	int tax;

	cout << " Enter amount of Ziploids earned" << endl;
	cin >> ziploids;

	if (ziploids <= 5000)
	{
		tax = ziploids * 0;
		cout << " Your tax is " << tax << endl;
	}
	else if(ziploids >= 5001 && <= 10000)
	{
		tax = ziploids * .10;
		cout << "Your tax is " << tax << endl;
	}
	else if(ziploids >= 10001 && <= 20000)
	{
		tax = ziploids * .15;
		cout << " Your tax is " << tax << endl;
	}
	else if (ziploids > 20001)
	{
		tax = ziploids * .20;
		cout << " Your tax is " << tax << endl;

	return 0;
}
Your last else if is unnecessary. Also, you need to add ziploids to the second part of your other else if statements. see:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
#include <iomanip>

using namespace std;

int main ()
{
	double ziploids;
	int tax;

	cout << " Enter amount of Ziploids earned" << endl;
	cin >> ziploids;

	if (ziploids <= 5000)
	{
		tax = ziploids * 0;
		cout << " Your tax is " << tax << endl;
	}
	else if(ziploids >= 5001 && ziploids <= 10000)
	{
		tax = ziploids * .10;
		cout << "Your tax is " << tax << endl;
	}
	else if(ziploids >= 10001 && ziploids <= 20000)
	{
		tax = ziploids * .15;
		cout << " Your tax is " << tax << endl;
	}
	else{
		tax = ziploids * .20;
		cout << " Your tax is " << tax << endl;
	}
	return 0;
} 
closed account (zCR4E3v7)
Thanks a bunch to those who helped and to those with rude snarky remarks... this is supposed to be a community to learn from not get put down for mistakes, OBVIOUSLY everyone start from somewhere.
Topic archived. No new replies allowed.