Fifteen students named their favourite season. You will count the answers, check the total and find the winner. Then the program draws each count as a row of hash signs, a bar chart made of text.
The idea. A tally adds 1 to an answer's count each time the answer appears. The counts must add up to the number of answers.
Your tasks.
a.total to the sum of all the counts.winner to the season with the largest count.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…