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 04:00
When you collaborate or meet with a person or group online, it is called
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
question
Computers and Technology, 24.06.2019 12:00
An npn transistor is correctly biased and turned on if the a. base is negative. b. collector is negative. c. collector is positive with respect to the emitter and negative with respect to the base. d. collector is the most positive lead followed by the base.
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
Your mom wants to purchase a laptop computer. she said she wants her new computer to be able to play her dvds so she can listen to music and wants to know what type of optical drives will play her disk. which type of drive should she look for?
Answers: 1
You know the right answer?
Write a program Election that computes the tally in a write-in election, and announces the winner....
Questions
question
Social Studies, 24.09.2019 09:30
question
Social Studies, 24.09.2019 09:30
question
Chemistry, 24.09.2019 09:30
Questions on the website: 13722363