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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started