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.
in c++ 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.
in c++
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.
Step by step
Solved in 3 steps with 6 images