Question: Using Python solves the following problem. The input to your program will be a list of votes cast in a city election. Each line will

Using Python solves the following problem. The input to your program will be a list of votes cast in a city election. Each line will contain one the name of a candidate. The end of input will be denoted by ***, which is not to be counted as a vote. If there is a candidate that obtained a simple or absolute majority (i.e., they received more votes than anyone else), display the name of that candidate. If no candidate obtained a simple majority, display "RUNOFF!". You may assume that there is at least one vote and that the input will be entered using the standard input.

Here are some examples of what your program should operate:

Using Python solves the following problem. The input to your program will

Input Output Franklin Roosevelt Franklin Roosevelt Wendell Willkie Franklin Roosevelt Franklin Roosevelt John Doe Wendell Willkie Franklin Roosevelt RUNOFF! Homer Tweety Shaggy Homer Tweety Shaggy Yosemite Shaggy Shaggy Shaggy

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!