| Create an electronic vote counter.  Each candidate in the election will be identified simply by a number (1, 2, 3...).  As input, the user should be able to enter the number of votes each candidate received.  The output will consist of: 
        The total number of votes cast in the electionThe average number of votes received by candidatesThe number of candidates who received more than the average number of votesA table showing, for each candidate, the candidate's number, the number of
          votes received, and percentage of the total votes receivedThe winner of the election and number of votes received by the
          winnerThe runner-up in the election and number of votes received by the
          runner-up Some additional requirements: 
        The maximum number of candidates in this election is ten, and the
          minimum is two.  Use one of the techniques discussed in class for obtaining a variable number of input values from the user (a sentinel value, or prompting the user to enter the number of candidates first).You should validate all input appropriately.The table must be printed by a separate method, which has at least one parameter that is an array.  Make use of other methods as
          appropriate (i.e., performing repeated tasks).The percentage of the total vote should be rounded to two decimal places and be followed with a percent
          sign (e.g., 34.59%, 75.1%, etc.).  You can accomplish this with a  DecimalFormat object (LL p. 90).Ignore the possibility of ties.I will not give you an algorithm for determining the runner-up; you
          must solve that problem on your own.    |