Question: You are given a list of strings where each string represents a person s name. Your task is to write a program that will count

You are given a list of strings where each string represents a persons name. Your task is to write a program that will count the frequency of each name in the list using a Dictionary map and print out the names with their corresponding frequencies.
Essentially, youre running an election and want to determine who has the most votes.
If a candidate obtained a simple or absolute majority of all votes cast (that is, more than any other candidate), output the name of this candidateand the number of votes they received. If not candidate obtained a simple majority, ouptu Runoff Election! and list the candidates involvedand the number of votes they received.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!