Well, there is no closing brace in the code you've posted. So I suppose my eyes tell me the same thing that the compiler is telling you.
Well, that's one problem solved. One more while I'm here.
1 2 3 4 5 6 7 8
|
char q1;
cin>>q1;
if (q1="a" || "A" || "a." || "A.")
{
job="Farmer";
jobnum=1;
}
|
q1
is a variable which holds a single character.
"a"
is a string of characters (because it uses double quotes).
You need to compare q1 with a character constant in single quotes, like this:
'a'
if we change this
q1="a"
to this
q1='a'
it's a step in the right direction, but still not right. The
=
operator is used to assign a value to a variable, so regardless of what the user typed, q1 now contains 'a'. Instead it needs to use the
==
operator to test for equality.
The strings "a." and "A." are two characters long and it doesn't make sense to compare them with a single character input. So discard them.
And finally, q1 needs to be compared separately with each required value, like this:
if ( q1 == 'a' || q1 == 'A' )
Well, having noticed that, my instinct is that there are likely to be other problems. But this should help a bit...