subject

Write a program Election that computes the tally in a write-in election, and announces the winner. Since the votes are write-in, there is no pre-determined set of candidates. Whoever
appears the most in the votes is the winner. The user enters the individual votes, one vote
per line, and ends entering with typing -1 or an empty line. To compute the tally, the
program uses two arrays, a String [ ] variable (names), and an int[] variable (count). Upon
receiving a single vote, the program checks if the name on the vote appears in names, and if
it does, the program adds 1 to the value of the element in count. If the name does not
appear in names, the program extends both arrays by one element, stores the name in
names at the last position and store 1 in count at the last position. In this manner, the two
arrays will have the same lengths. The initial length is o for both arrays.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
The two main ways in which marketers address the competition with their strategies are by satisfying a need better than a competition and by
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Ramona enjoys her job because she is able to kids in an after school program. the work value ramona feels strongest about is a. leadership b. risk c. independence d. work with people select the best answer from the choices provided a b c d
Answers: 1
question
Computers and Technology, 24.06.2019 07:20
Ingrid started speaking about her slide presentation. when she clicked to th"third slide, which had just a picture of an elephant, she forgot what she wassupposed to talk about. what could ingrid do to avoid this situation in thefuture? oa. print handouts for her audience.ob. add presenter's notes to each slide.oc. add a video to each slide.od. save her slide presentation to a flash drive
Answers: 2
You know the right answer?
Write a program Election that computes the tally in a write-in election, and announces the winner....
Questions
question
English, 22.01.2021 20:10
question
Mathematics, 22.01.2021 20:10
question
Arts, 22.01.2021 20:10
Questions on the website: 13722363