Fall 2003/Spring 2004: CS333 - Problem Solving and Object Oriented Programming in
C++
[ Home |
Schedule
| Personal
Progress | Search |
Glossary |
Help
]
Objectives:
To build objects using other objects (Principle: Object Composition)
Functional Requirements:
In this assignment you are to implement a "TimeDate" class with features given below. A "TimeDate" is represents by a date and time (e.g. 3:30PM on 21SEP2003). This class will be built using a Date class and a Time class object (more details below) and thus will have data members for these types.
Features of the "TimeDate" class:
Default constructor which sets the initial value of a "TimeDate" to an appropriate state.
Non default constructor which takes two
parameters (a "Date" and a "Time" object)
(you may use any suitable definitions of a "Date" and
"Time" object from previous assignments and the book)
A set function that sets the Date (one parameter)
A set function that sets the Time (one parameter)
A get function that returns the "Date" part of a "TimeDate"
A get function that returns the "Time" part of a "TimeDate"
Write a main test driver function "main.cpp" that will test the TimeDate class thoroughly - it will take as input a "Time" and a "Date" in the format "hour minute second day month year" and will print out the TimeDate as a Date (using the print format of assignment 1 and 2) and the Time (using the printstandard function from the book). For example, to input the TimeDate for one minute after noon July 4, 2002 (uses my solution to illustrate input and output - input in red - I have left out some of the output which is used in other testing)
Enter time (hour minute second) and date (day month year): 12 1 0 4 7 2002 12:01:00 PM on 4JUL2002
Non-functional Requirements:
Put all files in a "assn3.zip" file for submission
Submission: