Activity 5.4 - Providing the code for the class UserComputers

Topic

This activity uses a hash map to associate the names of users with the names of the computers they use.

Materials

In addition to the Solution document, the project for this activity contains two classes:

Task

The class UserComputers is to have a one-argument constructor and the following public methods:

The skeleton class provided gives the specifications of these methods in the form of comments. Your task is to implement the methods, using appropriate utility methods from the HashMap class. You will also need to import the necessary Java package.

Instructions

Open the class UserComputers. Add an import statement where shown. Then fill in the body of the constructor and the four methods, following the specifications given.

Run the project, and check that the output is as you expected