Hello. I am trying to figure out what is wrong with my program. Currently it is telling me that "C2228: left of '.cin' must have class/struct/union" and "C2181: illegal else without matching if". I've been trying to figure out what I did wrong but everything I do does not work. The program is supposed to accept either "S" or "J" and show the certain amount of money that letter makes.
#include <iostream>
usingnamespace std;
int main()
{
int S;
int J;
cout << "Please Enter S for Senior Engineer and J for Junior Engineer" << endl.
cin >> S >> J;
if ( S == 'S') {
cout << "The Senior Engineer makes $1700 per week.\n";
else cout << "Error.\n";
}
if ( J == 'J') {
cout << "The Junior Engineer makees $900 per week.\n";
else cout << "Error.\n";
}
cout << "Thank you";
return 0;
}