2- Create a class time24, each object is a value represented the time of day in the form hours, minutes and seconds. Provide a constructor that enables an object of this class to be initialized when it is instantiated. The constructor should contain default values in case no initializes are provided. Provide Public member functions for each of the following operations: set the time, print the time, increment the time by one second, compare two times for equality, increment the time by one hour, determine if one time is “less than” (comes before) another time, and final print the time in format 12 hours. Include any additional operations that you think would be useful for your class. Design, implement, and test your class.
2- Create a class time24, each object is a value represented the time of
day in the form hours, minutes and seconds. Provide a constructor
that enables an object of this class to be initialized when it is
instantiated. The constructor should contain default values in case no
initializes are provided.
Provide Public member functions for each of the following
operations: set the time, print the time, increment the time by one
second, compare two times for equality, increment the time by one
hour, determine if one time is “less than” (comes before) another
time, and final print the time in format 12 hours.
Include any additional operations that you think would be useful for
your class.
Design, implement, and test your class.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images