Question: Download the poll.txt and the Election.java Open Election.java and write a method to read poll.txt of poll data. - Each line in the poll.txt is
Download the poll.txt and the Election.java Open Election.java and write a method to read poll.txt of poll data. - Each line in the poll.txt is formatted as follows: State Obi Wan\% Darth Vader\% ElectoralVotes Pollster MO 484611 Oct Zogby MT 44403 Oct Montana State U. NE 37565 Sep Rasmussen NV 48445 Oct Zogby - Each line represents the poll results from each state. For example, MO is the state name followed by 48 (Obi Wan votes), 46 (Darth Vader voites). In MO, Obi Wan wins the state, hence 11 electoral votes Wvill be added for Obi Wan. - In NE, Obi Wan 37 vs Darth Vader 56 , hence add 5 electoral votes for Darth Vader. - If there's a tie, no electoral vote should be awarded. - Line based scanning is required for this assignment. - The method should print how many electoral votes each candidate leads in. Sample output is as follows
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
