CS12
Assignment 4
Due: 11:59 PM Monday, June 5 NO EXTENSIONS(or whatever)
Topics Covered By this Assignment
In this assignment you will be re-using the program you made for assignment 3. In assignment 3 you made a CD class to hold information about a CD. Functions related to manipulating the information for ONE CD were supposed to be in the CD class, while other functions related to manipulatinf information for the entire collection of CDs were not in the class. Your task for assignment 4 is to create a new class to represent the collection of CDs. You will have to decide what information should be in this new class and what should be part of the old CD class. If you did your assignment 3 correctly you should not need to modify your CD class at all (except for the operator overloading). This part of the program should not be too difficult and should consist primarily of taking your old code and re-organizing it into the CD case/collection class.
Your program should be able to do all the things that assignment 3 could do. In addition your program should implement the following functions:
CDCollection allcds;
.
.
Input a few cds
.
.
cout << allcds;
It should output all the CDs in the collection to cout.
You should also overload individual CDs. For example if I have:
SingleCD mycd; cout << mycd;It should output the information for that one CD. This means that you will overload the extraction operator twice, once for each class.
This assignment must be done using the Linux operating system. Be sure to divide your program into separate files, and be sure to write and turn in a makefile (with a clean option). When you turn in your assignment, only turn in the header files, the .cpp or .cc files, and the makefile. As a piece of advice, DON'T DO IT IN WINDOWS AND THEN TRY TO MOVE IT TO LINUX. I don't have time to listen to everyone's sad story about how it worked in windows and then suddenly didn't work when they tried it in linux. Linux is not that hard. All you need to know is how to start an editor (click on a button), make a makefile (covered in class and in labs), type make, and run the program. If you are having any difficulty with linux, let me know right away. I am always happy to answer any questions on it. You should also LEARN TO USE THE DEBUGGER. I can't stress this enough. When you start working on larger programs, no ammount of starring at your code will fix any of the bugs. Again, please ask and get help from me or the TAs if you don't understand how to use the debugger. I am always glad to help, but if you bring code to me and say "It doesn't work", there's not much I can do. You should be able to run it through the debugger step by step and figure out where it's stops working like it is supposed to. If you've pinpointed the area that is giving you a hard time, it is much easier for me to help. Again. START EARLY this assignment might take you a while. Good luck!