Constructors
- The class should have a default constructor (no parameters),
which should initialize the object so that it represents the quantity
0.
- The class should also have a constructor with a single integer
parameter,
which represents a quantity of seconds -- which should be translated into
the appropriate notation for a Time object. Note that this constructor
with a single parameter will be a "conversion constructor" that allows
automatic type conversions from "int" to "Time". If the parameter is
negative, default the Time object to represent 0.
- The class should also have a constructor that takes 4 parameters,
representing the days, hours, minutes, and seconds to use for
initializing the object. If any of the provided values are negative,
default the Time object to represent 0. If any of the provided
values are too high (but all non-negative), simplify the object to the
appropriate representation
Examples:
Time t; // this creates an object which is 0 days, 0 hours, 0 minutes, 0 seconds
Time s(1234); // this creates an object representing 0 days, 0 hours, 20 minutes, 34 seconds
Time r(-123); // creates an object representing 0 days, 0 hours, 0 minutes, 0 seconds
t = 4321; // conversion constructor allows this assignment.
// t now stores 0 days, 1 hour, 12 minutes, 1 second
Time x(1, 3, 5, 7); // 1 day, 3 hours, 5 minutes, 7 seconds
Time y(2, -4, 6, 8); // creates object representing 0, since -4 hours not legal
Time z(2, 25, 4, 62); // 3 days, 1 hour, 5 minutes, 2 seconds (simplified)