10 marksSearching and Sorting Algorithms
CAPE Computer Science Unit 2 · 2005 · Paper 1 · Question 9
A soft-drink manufacturer sells five soft-drink flavours: banana, cherry, mango, orange and pineapple. The company knows that banana and pineapple are the two best-selling flavours and is carrying out a poll to determine which of these two flavours is the more popular among its customers. Write an algorithm to find the more popular flavour and the number of votes it obtained. Assume that 100 customers participate in the poll and that there is no tie.
The mark scheme is shown once you've answered.
Practise this question