SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Walter Savitch ,kenrick Mock
Chapter:
Collections Maps And Iterators
Exercise:
Programming Projects
Question:5 | ISBN:9780132830317 | Edition: 5

Question

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.


TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Sorry the answer is not available at the moment…

If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.

Spread the 'tradition of sharing'.