Question: Write an application class (Time2Application) that uses the Time2 class in Figure 8.5, pg. 338. to perform the following task. 1. Create a time object
Write an application class (Time2Application) that uses the Time2 class in Figure 8.5, pg. 338. to perform the following task. 1. Create a time object that initializes the "hour", "minute" and "second" components to an invalid combination (e.g. hour = 25, minute = 61, sec = 0). Embed in a try-catch block that catches the exception thrown in the methods defined in the "Time2" class. 2. Create a time object and set the time to 11:15 pm 3. Create a loop for 10 iterations that performs the following a. adds 1 minute to the time b. Displays the time in standard time c. Displays the time in universal time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
