Simple nested if problem Please help

Thank you in advanced for helping me with this question. I have pasted my code which is obviously wrong so please anyone that can help with this?

required data:

years_employed <= 3 add 1 to j_count
years_employed >3 and <10 add 1 to r_count
years_employed >= 11 add 1 to s_count

Question:
the program uses and integer variable years_employed to define three groups of employees.
1) write a NESTED IF statement that tests years_employed and does the appropriate process

My Code:

#include "stdafx.h"
#include <iomanip>
#include <iostream>

using namespace std;

int main()
{
int years_employed,
j_count=0,
r_count=0,
s_count=0,

cout << "Enter the number of years employed ";
years employed = cin.get();
cout << endl;

if years_employed <=3 then
++j_count
{ if years_employed >3 and <= 10 then
++r_count
{if years_employed > 11 then
++s_count
}
cout << "j_count equals " << j_count << endl;
cout << "r_count equals " << r_count << endl;
cout << "s_count equals " << s_count << endl;
}
system pause;
return 0;
}
'then' is not a keyword in C++. See http://www.cplusplus.com/doc/tutorial/control/ .
ok that is definately not the only problem...is it my brackets? is the code completely messed? I removed the "then"

#include "stdafx.h"
#include <iomanip>
#include <iostream>

using namespace std;

int main()
{
int years_employed;
char j_count=0,
r_count=0,
s_count=0;

cout << "Enter the number of years employed ";
cin >>years_employed;
cout << endl;

if years_employed <=3;
++j_count
{ if years_employed >3 and <= 10;
++r_count
{if years_employed > 11;
++s_count
}
cout << "j_count equals " << j_count << endl;
cout << "r_count equals " << r_count << endl;
cout << "s_count equals " << s_count << endl;
}
system ("Pause");
Of course is not the only problem. I gave you the link so you can properly learn about the IF statement. Read it so you can find your other problems.
Topic archived. No new replies allowed.