Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started