Programming Assignments #1A:

Basics of User-defined Classes

Purpose: First exposure to user-defined classes. Declare, implement, and use your own DateType class.

********************************************************************

 

First, download and unzip this zip file (updated 02/01/2016) to get the basic framework of the code in a Visual C++ project, which includes the following source code files:

 

1.     DateType.h specifies the structure and the interface of the DateType class. Note that you should include the header file DateType.h in every .cpp file that uses the DateType class or implements the member functions of the DateType class.

 

2.     DateType.cpp implements the details of the member functions belonging to the DateType class.

 

3.     DateTest.cpp includes the header file DateType.h in order to use the DateType class. The main function in this file declares local DateType objects and calls the member functions of the DateType class in the context of these objects to test the implementation of the DateType class.

 

 

********************************************************************

 

Programming #1A Steps:

1.     Play with the executable of a fully implemented sample version: Download play with this sample executable to get some sense of the behavior we want from the objects of the DateType class when the DateType class is fully implemented in the end of this programming assignment.

 

2.     Understand the code framework: Open the entire visual C++ project by double clicking the solution file under the project folder. Examine and understand (i) how the DateType class is declared in DateType.h and implemented in DateType.cpp and (ii) how the main function in DateTest.cpp declares and uses objects of the DateType class to conduct tests on the DateType objects.

 

3.     Add code to complete the implementation of three existing simple member functions in the DateType class: Add your own code into DateType.cpp to complete the implementation of the PrintDate member function (for printing the date stored in the corresponding DateType object), the ComparedTo member function (for one DateType object to compare itself with another DateType object and return either LESS, EQUAL, or GREATER in terms of the dates stored in these two objects) and the ComparedCentury member function (for one DateType object to compare itself with another DateType object and return either LESS, EQUAL, or GREATER in terms of the centuries of the dates stored in these two objects) in DateType.cpp according to the specification given as comments in DateType.h.

 

4.     Test the implementation: The C++ code for processing the R option (i.e. test 3) in the main function is commented out at the moment. After you have implemented things in Step 3 above, please uncomment the part of testing code under the R option (i.e. test 3) in the main function in DateTest.cpp and then run the program using the R option to test your implementation in step 3 above.

 

 

Submit your work for Programming #1A:

       Two things to submit: (i) Compress your entire Program 1A folder into a zip file and upload it through Biola Canvas. (ii) Carefully fill out this self-evaluation report and upload it through BiolaCanvas.

 

       Note that you will receive no point for missing the self-evaluation report or missing the integrity review in the report.