this is the draft syntax
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#include <iostream>
#include <string>
using namespace std;
int main ()
{
cout << "THIS IS A SIMPLE POLL" <<endl;
string q1;
cout << "NAME:" <<endl;
getline (cin,q1);
string q2;
cout << "AGE:" <<endl;
getline (cin,q2);
string p1;
cout << "Do you drink milk at breakfast? Y/N " <<endl;
getline (cin,p1);
string p2;
cout << "Do you eat cereals on your breakfast? Y/N " <<endl;
getline (cin,p2);
string p3;
cout << "Do you take bananas on your breakfast? Y/N " <<endl;
getline (cin,p3);
cout << "Total number of persons who drink milk at their breakfast: "<<p1<<endl;
cout << "Total number of persons who eat cereals on their breakfast: "<<p2<<endl;
cout << "Total number of persons who take bananas on their breakfast: "<<p3<endl;
system("PAUSE");
return 0;
}
|
1st of all i got another pending thread.. sorry for multi threading as i dont want to mix stuffs in one thread :) anyways,
i know that in my draft syntax to make a poll it should go that way..
but its only a draft anyways :)
so what my issue is..
for example i need like 5 persons to answer a poll
and on lines 15,18 and 21 they will answer only with Y/N and what do i want to happen is at line 24,25 and 26 i want to see how many people answered Y or N and also..
how can i make the lines 9,12,15,18 and 21 repeat it self (cuz its time for the 2nd person to take the poll) without actually retyping all of them (or copy and paste)
do i need to set an integer/variable value to Y/N so that it displays the number of persons who says either Y/N and if so..
how?
cheers,
xei.