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.";