Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for Java The purpose of this question is to model a scenario of your choice with a small application that makes use of

This is for Java

The purpose of this question is to model a scenario of your choice with a small application that makes use of a map and provides the user with the ability to store, manipulate and extract data.

I need least 1 class of your own to model your scenario. You can add further classes of your own if you wish, but it is not essential, and you should avoid making your scenario too elaborate. We advise against adding further classes unless you are confident of what you are doing and are sure you have enough time to complete the coding.

  • The keys must be of type String or Integer.
  • The value types must be either a List or a Set from the Collections Framework, as is the case with the example scenarios given above.The values must not be references to individual objects.
  • (So for example in the league example above, in the map, values arenotindividual Player objects, butsetsof Player objects.)

Can someone help me fill in this table correctly

General scenario

Type of key (String or integer)

Type of value (must be from Collections framework)

Type of map (sorted or unsorted)

Description of any additional classes

Below are 2 Examples (Which I can't Use)

Scenario: a council keeps records of names of the registered voters on a specific street using a sorted map, each key of the map is an Integer, which represents the number of a house in that street, and the values are Lists of Strings where each string in a List represents the name of a voter living at that house number.

Scenario: a league is keeping a record of teams by using a sorted map, where the keys of the map are Strings, each representing the name of a team, and the values are Sets of players. Players are represented by objects of a "bespoke" class - Player, designed especially for this application, with attributes name, position, goalAverage and salary.

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Programming questions