Question
Write a method that reads candidates information from an input file, an example of which follows: 2 Trump:35:8 Biden:18:26 The first line consists of a
- Write a method that reads candidates information from an input file, an example of which follows:
2
Trump:35:8
Biden:18:26
The first line consists of a number that specifies how many candidates are running for the US presidential election. If that number is n, the next n lines each specify a candidate, with the candidate's name appearing on the line first, followed by a colon, and followed by the number of popular and electoral votes received by that candidate each separated by a colon. Then the method finds and returns the winner information who got the maximum electoral votes. You may assume that the input file will always be properly formatted according to this specification.
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