Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 13 Some student information of a class is listed below: Class A: Name Ada Lee Student ID 1122 2233 3344 4455 John Chan Kitty
Question 13 Some student information of a class is listed below: Class A: Name Ada Lee Student ID 1122 2233 3344 4455 John Chan Kitty Leung Wilson Chan The above information is to be stored in a map (Map) referenced by classMap. The studentID is assumed to be unique in the class. (a) Write a program segment to store the above information of the class in a map classMap. Remember to create it first. [2 marks] () Assume that there are many entries in the map. Write a method findIDs (String str) to return a list of student IDs with str as part of their names. [4 marks] (c) Assume that there are many entries in the map. Write a method countLastNames () to return a map (Map) with last names as the keys and their number of occurrences as the values. The format of the names in the map are assumed to be "firstName lastName", with exactly one space between firstName and lastName. For example, using the data of Class A table, a map "{Chan=2, Lee=1, Leung=1)" should be returned. [9 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started