Question: please solve this java programme quickly it is a lab and it will finish in one hour and a half Exercise#1: Time Class Write a

please solve this java programme quickly it is a lab and it will finish in one hour and a half
please solve this java programme quickly it is a lab and it

Exercise#1: Time Class Write a Java class named MyTime that contains three data members which are hour, minute, and second. Note that the valid values for hour, minute and second are: 0-23, 0-59, 0-59 respectively. The class should implement the following constructors/methods: . A default constructor that sets all the data members to zero. A constructor with arguments that sets the time to given hour, minute, and second. get and set methods incrementSecond(), incrementMinute(), and increment Hour(): increment time by one second, one minute, and one hour respectively. . toString():represents a myTime object in universal time format (HH:MM:SS). toStandard Time(): converts the time to standard time format (H:MM:SS AM/PM) Write a test program that creates a myTime object with hour, minute, and second given as input from the user. Print the object myTime in both universal and standard format. Increment the time by one second and print the new time in the universal format: Sample input/output Enter the time starting with hour, minute and second: 7859 The time in universal format is: 07:08:59 The time in standard format is: 07:08:59 AM The new time after one second is: 07:09:00 Enter the time starting with hour, minute and second: 23 59 59 The time in universal format is: 23:59:59 The time in standard format is: 11:59:59 PM After one second, the time is: 00:00:00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!