need HELP correcting this program

I am trying to write an if else program that gives the tax and child credit based on three options: if your income is less than 30,000, (no tax, child credit 1000*num of children) , greater than 100,000 (20% tax, no child credit), and between 30,000 and 100,000 (10% tax, 500*num of children). I get the idea of it but I need help correcting/placing things in the right order. Also, I have trouble choosing the correct formula. This is what I have so far. Any help will be greatly appreciated.

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
#include <iostream>

using namespace std;
float i, t, cc, c, d;

int main()
{
	cout << "please enter your income" << endl;
	cin >> i;
	cout << "how many children" << endl;
	cin >> c;

if (i<=30000)
t=0.0;
if (c>0)
cc=1000*c;

if ((i>30000)&&(i<=100000))
	t=(i-30000)*0.1;
if (c>0)
cc=c*500;

else
 	t=(i-100000)*0.2;
if (c==0)
cc=0;
cout << "tax equals  " << t << endl;
cout << "child credit equals  " << cc << endl;
return 0;
}
Last edited on
Do not double-post. Previous: http://www.cplusplus.com/forum/general/231286/
Topic archived. No new replies allowed.