The Assignment
This assignment asks you to extend your previous assignment so that the WineCellar can keep the Wines in an organized way. Specifically, you are asked to augment your previous assignment as follows:
- Make the Wine class Comparable such that when two Wine bottles are compared, the comparison is based primarily on type and secondarily on year.
- Add an insertInOrder method to the WineCellar class that inserts new bottles of Wine in order as determined by a comparison of the bottles. Please note that this method need only work if each and every bottle has been added using this method.
- Add a menu option for insertInOrder to your Menu.
Some Code
For those who didn't get through the last assignment, the following pieces should get you started here: