Computer Science, asked by shaikhzeba2006, 2 months ago

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-determine 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 complete the tally, the program uses two arrays, A String[] variable(names), and an int[] variables (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 elements in count. if the name doesn't appear in names, the program extends both arrays by one elements, stores the name in names at the last positions 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.​

Answers

Answered by srishti539
0

Answer:

Input : votes[] = {"john", "johnny", "jackie",

"johnny", "john", "jackie",

"jamie", "jamie", "john",

"johnny", "jamie", "johnny",

"john"};

Output : John

We have four Candidates with name as 'John',

'Johnny', 'jamie', 'jackie'. The candidates

John and Johny get maximum votes. Since John

is alphabetically smaller, we print it.

Answered by Anonymous
1

Answer:

1.for making the text look coloured refer the below syntax and ignore the dots

[.tex]\red{the\:text\:appears\:in\:red}[./tex]

result

\red{the\:text\:appears\:in\:red}thetextappearsinred

2.for making the text marquee

[.tex]<marquee>{the\:text\:appears\:like\:this}</marquee>[./tex]

result

= < marquee > {the\:text\:appears\:like\:this} < /marquee > <marquee>thetextappearslikethis</marquee>

3. for making the text look bold

[.tex]\bold{the\:text\: appears\: like\: this }[./tex]

result =

\bold{the\:text\: appears\: like\: this }thetextappearslikethis

4. for showing the exponential value

[.tex]{no.}^{power}[./tex]

result

= {no.}^{power}[ /tex] 5. for showing the square root value [.tex]\sqrt{no.}[./tex] result = \sqrt{no.}no. </p><p>power</p><p> 5.forshowingthesquarerootvalue[.tex]

no.

[./tex]result=[tex]

no.

\bold{\boxed{thanx}}

thanx

follow me next

Similar questions