You are on page 1of 2

ASSIGNMENTS USING CLASSES AND OBJECTS

-> create a class/object for time


-> it should have member functions
-> sethour(int hour)setminute(int min) ,
setsecond(int sec)
-> which should check and throw an exception when
invalid parameters are entered.
-> it should also have member functions like
gethour() , getminute() , getsecond() for outputting
any of the time fields at a particular instant.
-> also utilise pointer to a object to output values to
possible extent.
-> also try to take default system time using
time.h(headers) and inbuilt structures such as time_t and
its fields if default constructors were invoked by calling
without arguments in main.
-> also try to inherit this base class time to derived class
date which will affect relevant fields of date class.
-> relevant extra member functions in date should be
used such that they inturn use the time got from their
respective base classes.
-> here importantly conditions need to utilized
properly(on member variables) so that exceptions are
raised (thrown) and caught such that it gives a replica of
leap year also.

You might also like