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 10:30
Auniversity wants to install a client-server network. which feature do you think is important for them as they set up the network? sending email blocking multiple people to use the same file low security low set up cost limited access to files
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
The average cost of one year at a private college in 2012-2013 is $43,289. the average grant aid received by a student at a private college in 2012-2013 is $15,680.   what is the average student contribution for one year at a private college in 2012-2013?
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
Jaina and tomas are being considered as new tenants in an apartment. the landlord looks at their creditworthiness because he wants to be sure his new tenant pays the rent on time and in full. the table below summarizes the information that was on their applications. application information questions jaina tomas how many years have you had your job? 5 2 what is your monthly salary? $1,850 $2,500 how many credit cards do you have? 4 1 how much debt do you have? $13,000 $7,000 how many times were you late with payments on credit cards in the past year? 5 1 who will the landlord decide to be more creditworthy and why? tomas because the ratio of his debt to income is less. jaina because she has had her job longer, which makes her look more stable. jaina because she has more credit cards available to her. tomas because he makes more money per month.
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
Three out of five seniors remain undecided about a college major at the end of their senior year.
Answers: 3
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, 14.07.2021 16:40
question
Mathematics, 14.07.2021 16:40
question
Mathematics, 14.07.2021 16:40
question
English, 14.07.2021 16:40