Computer Science, asked by jjmr15, 1 year ago

pls ans fast pls 10 points

Write a program in Java to stores names of the 10 politicians and their party to which they belong to in two separate arrays. Ask the users to enter the name of the party. Printout all the names of the politicians who belong to that party. Repeat the process according to user choice.

Answers

Answered by rajkumarmeena1
0

Explanation:

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.

Similar questions