Pseudo Code

Pseudo code is intended to be programming language independent to allow the reader to understand the algorithm without specific programming language knowledge:

procedure FlavourConcensus
while (no single flavour has been chosen by 10 people) do (
if (this is the first round of questions) then (state that our aim is to reach a consensus) else (present each person with the current flavour choice totals and remind them that we need to reach a consensus)
while (every person has not selected a flavour) do (ask each person to select a flavour and record the total for each flavour chosen)
) end while
) end while
do ( print the message “Concensus reached, Flavour X has been chosen by all 10 people”)

I have assumed here that we can keep asking questions until the consensus is reached however this is not realistic as we allow each person to change their choice each time they have not reached a consensus and this presents the possibility of a never ending algorithm (even though I have tried to encourage the people to choose the most popular flavour by reminding them of the aim and the running total after the first round of questions). Therefore I suggest including a method of forcing a consensus to be reached by the elimination of the least popular flavour on each round of questions:

procedure FlavourConcensus
while (no single flavour has been chosen by 10 people) do (
if (this is the first round of questions) then (state that our aim is to reach a consensus) else (present each person with the current flavour choice totals and remind them that we need to reach a consensus)
while (every person has not selected a flavour) do (ask each person to select a flavour)
do (calculate the total for each flavour chosen)
if (we have a least popular flavour) then (remove the least popular flavour from the choices)
) end while
do ( print the message “Concensus reached, Flavour X has been chosen by all 10 people”)

References

Glenn, J. (2009) Computer Science: An Overview. 10th ed. Boston: Pearson Education.