Assignment 8: Collections and More User Interaction Practice

Objective: To get experience using collections

Due: Before class on Wednesday

Type Parameter

Modify your MediaItem class such that it implements the Comparable interface with the parameterized class type, in this case MediaItem. Eclipse will guide you with how to fix the warning.

Also, fix any issues mentioned in feedback on previous assignments.

Notes

Modifying Library Driver: Using Collections

We discussed several different types of collections: lists, sets, and maps. In your driver program for the MediaItems, instead of an array, use an appropriate collection to store your items. Before making your choice, consider how easily you can implement the same functionality as in the last assignment, e.g., easily you can store items, retrieve items, and sort items.

This part is underspecified on purpose. You may want to look at the user interaction requirements below before making a decision. In comments in your driver program, defend your choice of collection.

User Interaction

We've now dealt with handling user input. Modify your driver program so that it provides a menu for the user to manipulate the library. Allow the user to

Here is some code to help you get started.

Cleaning Up Your Code

If I have been giving you feedback about poor variable names, poor method naming, poor coding practices, poor formatting, inefficient code, not encapsulating, etc., clean up your code before submitting. Use Eclipse's refactoring and formatting tools and note any warnings too and see if you can clean up your code a bit.

Output

Save output from one run of your UserInterface in a file.

Turnin

Copy your code into an assign8 directory in your turnin directory.

Grading (100 pts)

You will be evaluated based on the following criteria: