<<
global q1_yes;
global q1_no;
global q2_a;
global q2_e;
global q2_i;
global q2_o;
global q2_u;
case yesno of
"Yes": q1_yes = q1_yes + 1;
"No": q1_no = q1_no + 1;
end case;
case Vowel of
"A": q2_a = q2_a + 1;
"E": q2_e = q2_e + 1;
"I": q2_i = q2_i + 1;
"O": q2_o = q2_o + 1;
"U": q2_u = q2_u + 1;
end case;
total_q1_answers = q1_yes + q1_no;
total_q2_answers = q2_a + q2_e + q2_i + q2_o + q2_u;
q1_yes_pcnt = (q1_yes / total_q1_answers * 100) as integer;
q1_no_pcnt = (q1_no / total_q1_answers * 100) as integer;
q2_a_pcnt = (q2_a / total_q2_answers * 100) as integer;
q2_e_pcnt = (q2_e / total_q2_answers * 100) as integer;
q2_i_pcnt = (q2_i / total_q2_answers * 100) as integer;
q2_o_pcnt = (q2_o / total_q2_answers * 100) as integer;
q2_u_pcnt = (q2_u / total_q2_answers * 100) as integer;
>>
Survey Results
The results so far are:
Question 1: Is the answer Yes?
- {q1_yes} people ({q1_yes_pcnt}%) say Yes.
- {q1_no} people ({q1_no_pcnt}%) say No.
Question 2: Name your favorite vowel
- {q2_a} people ({q2_a_pcnt}%) say A.
- {q2_e} people ({q2_e_pcnt}%) say E.
- {q2_i} people ({q2_i_pcnt}%) say I.
- {q2_o} people ({q2_o_pcnt}%) say O.
- {q2_u} people ({q2_u_pcnt}%) say U.