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, 22.06.2019 12:40
How do i get the most points, without any effort?
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
This program should be a short piece of code that prints all of the positive integers from 1 to 100 as described more fully below. the program may contain multiple methods, and if using an oo language, should be contained within a single class or object. the program should be designed so that it begins execution when invoked through whichever mechanism is most common for the implementation language. â–ş print out all positive integers from 1 to 100, inclusive and in order. â–ş print messages to standard output, matching the sample output below. â–ş in the output, state whether the each integer is 'odd' or 'even' in the output. â–ş if the number is divisible by three, instead of stating that the number is odd or even, state that the number is 'divisible by three'. â–ş if the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is 'divisible by two and three'. â–ş design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic. sample output the number '1' is odd. the number '2' is even. the number '3' is divisible by three. the number '6' is divisible by two and three.
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Which task uses a simple parameter?
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
What is the error in the following pseudocode? module main() call raisetopower(2, 1.5) end module module raisetopower(real value, integer power) declare real result set result = value^power display result end module
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
question
Mathematics, 01.09.2021 18:30
question
Biology, 01.09.2021 18:30
Questions on the website: 13722362