Question: (Count the occurrences of names entered using Java programming language) A. Write a program that reads an unspecified number of names and finds the one

(Count the occurrences of names entered using Java programming language)

A. Write a program that reads an unspecified number of names and finds the one that has the most occurrences. The input ends when the input is EXIT. For example, if you entered

Mike Amelia William Amelia Lucas Amelia Henry Amelia Amelia Mike EXIT,

the name Amelia occurred most often. If not one but several names have the most occurrences, all of them should be reported. For example, since Mike and Amelia appear twice in the list Mike Amelia William Amelia Mike both occurrences should be reported.

B. Rewrite the program in A to display the names in ascending. (Hint: use a TreeMap)

Main purpose: Learn how to use basics of Java Collections Framework

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!