Create a class called Time with three data members to store
hr, min and seconds. Create two constructors (no argument, and
three arguments ) to set hr, min, seconds and a function put_time()
that displays a time in hr:min:sec format. Apply checks in constructor
to set valid time i.e Hours should be between 0 and 23, and minutes
and seconds between 0 and 59.If the values are not in above range
then use default constructor values.
Java Program for the Question
Answers
Answered by
1
tex
'/aart
three arguments ) to set hr, min, seconds and a function put_time()
that displays a time in hr:min:sec format. Apply checks in constructor
to set valid time i.e Hours should be between 0 and 23, and minutes
and seconds between 0 and 59.If the values are not in above range
then use default constructor values
Similar questions