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 22:30
Which of the following factors would your hypothetical supervisor look at when deciding whether to test a biological material sample for dna? the amount of other evidence you have implicating a suspect in a crime the annual budget for the crime lab both of the above none of the above; you would almost always order a test
Answers: 3
question
Computers and Technology, 23.06.2019 04:31
Acloud service provider uses the internet to deliver a computing environment for developing, running, and managing software applications. which cloud service model does the provider offer? a. iaas b. caas c. maas d. paas e. saas
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Asecurity policy is a a. set of guidlines b. set of transmission protocols c. written document d. set of rules based on standards and guidelines
Answers: 2
question
Computers and Technology, 24.06.2019 09:50
Suppose you are an ad-serving company and you maintain a log of cookie data for ads you serve to the web pages for a particular vendor (say amazon). a. how can you use this data to determine which are the best ads? b. how can you use this data to determine which are the best ad formats? c. how could you records of past ads and ad clicks to determine which ads to send to a given ip address? d. how could you use this data to determine how well the technique you used in your answer to part c was working? e. how could you use this data to determine that a given ip address is used by more than one person? f. how does having this data give you a competitive advantage vis-à-vis other ad-serving companies?
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
Mathematics, 30.10.2020 01:00
question
Physics, 30.10.2020 01:00
question
History, 30.10.2020 01:00
question
Mathematics, 30.10.2020 01:00
question
Mathematics, 30.10.2020 01:00
Questions on the website: 13722367