Module [M12] - Review
This module is meant as a review module to help you prepare for our comprehensive final exam. As such, it will not introduce new information but provide you with time to reflect as review what you studied, get plenty of hands-on practice, and seize opportunities to ask questions in the forums and book some office hours time with both instructor and TAs to get ready for the finals!
- Textbook Reading Assignments
- Review all sections that have been assigned since module [201]
Module Learning Outcomes
This module will allow you to strenghten your programing skills on the entirety of the learning outcomes we covered in this course.
Since there is no new material assigned to study for this module, you will be able to use this time to focus on preparing for the final. Be sure to make good use of the last week's extended office hours, official USF "Reading Days", and TA online sessions to get help.
The following programming exercise is meant to be a comprehensive application of many of the topics we have studied so far. The goals are rather open ended as the objective is to give you an excuse to practice what we learned. The details of the features implemented are therefore less relevant than the practice you get by working on this exercise.
Unlike all other homework exercises in this course, this one is NOT GRADED. As such, you are allowed (and even encouraged!) to work with other students on it. You are also strongly encouraged to attend this week's office hours and online sessions in order to get help completing it. The solution will not be provided but you will be helped reaching the skill level you need to complete this exercise. You just need to use the available help.
- Step #1 - Foundational Classes
-
We want to define a class Medium, as in "multi-media", that will represent a wide variety of entertainment objects.
This class will be subclassed by a few other classes like Book, MusicAlbum, Movie... Define a hieararchy and put into each class relevant attributes (the choice is yours); e.g. author, year of publication, title... Make sure to come up with attributes for each of the classes in your hierarchy; e.g. ISBN numbers are only for objects of the class Book.
Provide your classes with appropriate getters, setters and constructors. Also provide a toString method to make it easier to display the contents of your objects in a user friendly manner.
In order to test your classes, write an additional Main class featuring a main method that will create different objects of the above classes and display back their contents to make sure it is correct.
- Step #2 - Specificities of the Medium
-
A book may be available in printed form, in digital form, or could even be an audio-book. Similarly, a movie may be available in various formats; VHS (look it up), DVD, BluRay... Instead of having a ton of subclasses like MovieDVD and MovieBluRay, for each of the above subclasses of Medium, we are going to try something different.
Let's define inside the class Movie an enumerate type allowing to specify how the movie represented by an object of this class is actually stored; e.g. DVD, BluRay, LaserDisk (look it up).
We will also need a field in objects of classs Movie to store a value of this enumerate type. Let us call that field format. So, inside an object of class Movie, we will be able to set the format to an enumerate value representing how this particular Movie is owned.
Let us do the same for the classes Book and MusicAlbum.
Let us test using the Main class.
- Step #3 - Collections
-
We are now going to write a class to store a collection of Medium objects. Experiment with different Java Collection Framework solutions but make sure we have a way to add a new element, list all the elements of a specific type (e.g. all movies), and then list all elements of a specific type and specific format (e.g. movies in DVD).
- Step #4 - Make it Pretty
-
Now that we have the core features of our application implemented. Add a user interface allowing you to manage your collection. You have entire freedom regarding how the interface will look. However, make sure it allows you to perform all the above-described operations on a default collection object.
- Step #5 - Multi-Collections
-
Optionally, if you have time on your hand and a craving for more practice, extend further the above version so as to allow it to manage multiple collections.