Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logics For Databases And Information Systems

Authors: Jan Chomicki ,Gunter Saake

1st Edition

1461375827, 978-1461375821

More Books

Students also viewed these Databases questions

Question

How and when will I measure my success? True False

Answered: 1 week ago

Question

Organize and support your main points

Answered: 1 week ago

Question

Move smoothly from point to point

Answered: 1 week ago

Question

Outlining Your Speech?

Answered: 1 week ago