service { const html Setup =

The Polling Service

What is the question: ? ; const html Form =

The Polling Service

<[question]>

Yes    No ; const html Chart =

The Polling Service

<[question]>

Yes


noshade>

No


noshade> ; string question; int yes,no; void do_Init() { string q; yes = no = 0; show Setup receive[q = question]; question = q; } void do_Poll() { string answer; show plug Form[question = question] receive[answer = answer]; if (answer=="yes") yes = yes+1; else no = no+1; } void do_Result() { exit plug Chart[question = question, yes = (500*yes)/(yes+no), no = (500*no)/(yes+no)]; } session Init() { do_Init(); do_Poll(); do_Result(); } session Poll() { do_Poll(); do_Result(); } session Result() { do_Result(); } }