Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

a. What aspects of the situation are under your control?

Answered: 1 week ago

Question

10. Are you a. a leader? b. a follower? _______

Answered: 1 week ago

Question

What did they do? What did they say?

Answered: 1 week ago