Visit www.myprogramminglab.com to complete select exercises online and get instant feedback.
Exercise
Repeat the previous problem except create your own class, Name, that is added to a HashMap instead of a HashSet. The Name class should have three private variables, a String to store the name, an integer to store the number of namings for girls, and an integer to store the number of namings for boys. Use the first name as the key to the HashMap. The value to store is the Name object. Instead of ignoring the number of namings, as in the previous project, store the number in the Name class. Make the ArrayList a list of Name objects; each time you find a common name, add the entire Name object to the list. Your program should then iterate through the ArrayList and output each common name, along with the number of boy and girl namings.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.