Write a program with a class clock. It allows user to input the current time (24-hours format, using constructor). It has two member functions, one is to display the current time in 24-hours format, and the other one is to display the current time in 12-hours format.
the range of input time is 00:00:00~23:59:59.
24-hour format
hour:minute:second
12-hour format
(00:00:00~11:59:59)
hour:minute:second a.m.
(12:00:00~23:59:59)
hour:minute:second p.m.
The main function is provided, you only need to complete the Clock Class:
int main(){
int hour,minute,second;
cin>>hour>>minute>>second;
Clock clock(hour,minute,second);
clock.showin24();
clock.showin12();
}