Question: Write a C++ program: Create a class that describes a Time which has (Hours, Minutes and Second) the class contain (at least) the following methods:
Write a C++ program: Create a class that describes a Time which has (Hours, Minutes and Second) the class contain (at least) the following methods: shall . SetTime This method shall take 3 parameters for Hours, Minutes and Seconds. o .Show .Increment . ConvertToSec . CalcDiff SetTime o This method shall not take parameters and shall read them from the user o This method shall display the time as h:m:s. o This method shall increment the time by 1 second. o This method shall convert the time to number of seconds and return it This method shall take a time object and calculate the difference between that object and current time. It returns the difference as a time object. o The class shall also contain 2 constructors, one takes parameters and the other initializes the time variables by Os. In the main function you should test the class by writing the following void main) Time x, yz; for(int i-e;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
