YES/NO COUNTER

Does anyone know how to code Yes/No Counters? I'm working on a project and it's for an if-else statement. Below is a sample.

cout << "Did you spend a lot in groceries?";
cin << ans_1;
if (ans_1='Y') yes_ctr = yes_ctr+1;

cout << "Did you spend a lot in restaurants?";
cin >> ans_2;
if (ans_2='Y) yes_ctr = yes_ctr+1;
.
.
.
.
if (yes_ctr=0)
cout << "It seems that you do not spend money on such things.";

else if (yes_ctr>0)
cout << "Let's proceed to the questions that will follow.";

cin << ans_1;
When reading into the variable, the arrows go the other way: cin >> ans_1;

if (ans_1='Y')
should read
if (ans_1=='Y')
Likewise in other places
Topic archived. No new replies allowed.