Question: ANSWER IN JAVA PLEASE! Design and implement a Java application (CountNames.java) that reads an unspecified number of names and finds the one that has the

ANSWER IN JAVA PLEASE!

ANSWER IN JAVA PLEASE! Design and implement a Java application (CountNames.java) that

Design and implement a Java application (CountNames.java) that reads an unspecified number of names and finds the one that has the most occurrences (case insensitive). The input ends when the user enters zero. If not one but several names have the most occurrences, all of them should be reported. Here are some sample outputs: Sample #1: Please enter a name: John Please enter a name: James Please enter a name: john Please enter a name: John Please enter a name: 0 john repeated most Sample #2: Please enter a name: John Please enter a name: john Please enter a name: james Please enter a name: james Please enter a name: jack Please enter a name: 0 john repeated most james repeated most Sample #3: Please enter a name: 0 No name is entered! A few notes: Hint #1: Use a map to store the repetition of each name. (Key: Name, Value: Number of Repetition) Hint #2: You can use the values() method from the Collection interface to return values as a Collection object. Hint #3: You can use the keySet() method from the Map interface to returns all keys as a Set object

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!