COSC 1436 Lab 12
Purpose: In this lab you will add additional functionality to your Campus Clubs class.
Due: Before class, Section 2, April 23, 2013 and for Section 3, April 25, 2013
1. Modify your existing C++ clubs class as follows:
- Your Lab 11 must properly meet all the requirements given. None of the additions to this lab should affect the functionality of what you have completed previously. Do not try to separate your program into separate files until this is true. Make sure you keep a copy of the file before going on, you may very well need to go back to this configuration.
- Separate the portions of the lab into separate files. The main class must have both a .h and a .cpp file. The driver program must have its own .cpp file. There must be a Make file that will properly compile the program, based upon the status of the class and driver program. If your club class has multiple classes/structs in it, these may all be in the same .h/.cpp files.
3. Additional your class must include the following additional functionality:
- A default constructor, that initializes the class to values that indicate a non-initialized status.
- A constructor that takes in the name of the club as a cstring and properly initializes all of the members of the class.
- A copy constructor and overloading the '=' (assignment) operator. This pair of methods allows you to copy all of the contents of the class into a new implementation of the class. The overloaded assignment operator must work properly for multiple assignment. (A = B = C = D, where D has been previously assigned a value).
- A full set of comparison operators. You will need to overload the '==', '<', '<=', '>=', '>', and '>='. All the comparisons are based upon the name of the club, not any of the other class attributes!
Note: I highly recommend that you follow these steps in converting your Lab 11 program to the Lab 12 program. Do not go on to the next step, until the previous step works properly.
- Make sure that your lab 11 works properly. Do not start this lab until this has occurred.
- Create an empty directory for the lab. Break out your lab 11 into 3 separate files into your newly created directory, without adding in any of the new functionality. Build a make file for your program and make sure it executes properly. Remember the .h file needs include guards added to it. The class .cpp file and driver .cpp files needs the include statement so that the class file is included. Make sure that the program properly compiles and runs, before going on.
- Add the default constructor to your class, compile and test. Then add the constructor that uses the name of the club.
- Add the copy constructor to your class, compile and test. Then overload the assignment operator.
- Overload the '= =' operator to your class, compile and test.
- Add the rest of the comparison operators, they are minor variations of the '= =' you just added.
- Do the documentation and submit.
5. Prepare a lab report/documentation package. All of these items do not need to be in the same file or word document, but the main lab report file must reference each item by name. The lab report must includes the following information:
- Your Name
- Purpose of this program.
- Program psuedocode is not required for this lab.
- Program source code
- Program output (on disk)
- How was this program tested
- What problems/successes did you have with this program?
- An estimate of how much time you spent working on this lab
Grading Criteria: 100 points available for this lab.