427 B
427 B
Named & Default Arguments (#2)
Define a class SimpleTime
that stores the time elapsed from the beginning of
the day. SimpleTime
's constructor takes four parameters: hours
, minutes
,
seconds
and nanoseconds
. Each parameter has a default value of zero.
Implement two member functions, toSecondOfDay()
and toNanoOfDay()
, that
return the number of seconds or nanoseconds elapsed since the beginning of the
day.