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 0 for both arrays.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:00
Which software would you use to create a print design? a. illustrator b. audacity c. reaper d. dreamweaver
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Idon’t understand the double8 coding problem. it is java
Answers: 1
question
Computers and Technology, 23.06.2019 22:50
An environmental protection agency study of 12 automobiles revealed a correlation of 0.47 between engine size and emissions. at 0.01 significance level, can we conclude that there is a positive association between the variables? what is the p value? interpret.
Answers: 2
question
Computers and Technology, 24.06.2019 16:30
You may see the term faq on websites which stands for frequently asked questions this is an example of which type of mnemonic? a) poem b) acronym c) acrostic d) abbreviation ken has dipped many dark chocolate marshmallows (which you remember the metric system distance units in decreasing order: kilometers, hectometer, decameter, centimeter, millimeter) is an example of which type of mnemonic? a) poem b) acronym c) acrostic d) abbreviation !
Answers: 1
You know the right answer?
Write a program Election that computes the tally in a write-in election, and announces the winner. S...
Questions
Questions on the website: 13722363