*10.1 (The Time class) Design a class named Time. The class contains: 1 The data fields hour, minute, and second that represent a time. I A no-arg constructor that creates a Time object for the...

Hello, I don’t understand this Java Question may someone help me out, may you also submit the completed code typed out the code in text form please instead of a screenshot of a screenshot ?*10.1 (The Time class) Design a class named Time. The class contains:<br>1 The data fields hour, minute, and second that represent a time.<br>I A no-arg constructor that creates a Time object for the current time. (The<br>values of the data fields will represent the current time.)<br>10.indd 401<br>er 10 Object-Oriented Thinking<br>I A constructor that constructs a Time object with a specified elapsed time<br>since midnight, January 1, 1970, in milliseconds. (The values of the data<br>fields will represent this time.)<br>A constructor that constructs a Time object with the specified hour, minute,<br>and second.<br>1 Three getter methods for the data fields hour, minute, and second,<br>respectively.<br>I A method named setTime (long elapseTime) that sets a new time for the<br>object using the elapsed time. For example, if the elapsed time is 555550000<br>milliseconds, the hour is 10, the minute is 19, and the second is 10.<br>Draw the UML diagram for the class then implement the class. Write a<br>test program that creates three Time objects (using new Time (), new<br>Time (555550000), and new Time (5, 23, 55)) and displays their hour,<br>minute, and second in the format hour:minute:second.<br>(Hint: The first two constructors will extract the hour, minute, and second<br>from the elapsed time. For the no-arg constructor, the current time can be<br>obtained using System.currentTimeMillis (), as shown in Listing 2.7,<br>ShowCurrentTime.java. Assume the time is in GMT.)<br>

Extracted text: *10.1 (The Time class) Design a class named Time. The class contains: 1 The data fields hour, minute, and second that represent a time. I A no-arg constructor that creates a Time object for the current time. (The values of the data fields will represent the current time.) 10.indd 401 er 10 Object-Oriented Thinking I A constructor that constructs a Time object with a specified elapsed time since midnight, January 1, 1970, in milliseconds. (The values of the data fields will represent this time.) A constructor that constructs a Time object with the specified hour, minute, and second. 1 Three getter methods for the data fields hour, minute, and second, respectively. I A method named setTime (long elapseTime) that sets a new time for the object using the elapsed time. For example, if the elapsed time is 555550000 milliseconds, the hour is 10, the minute is 19, and the second is 10. Draw the UML diagram for the class then implement the class. Write a test program that creates three Time objects (using new Time (), new Time (555550000), and new Time (5, 23, 55)) and displays their hour, minute, and second in the format hour:minute:second. (Hint: The first two constructors will extract the hour, minute, and second from the elapsed time. For the no-arg constructor, the current time can be obtained using System.currentTimeMillis (), as shown in Listing 2.7, ShowCurrentTime.java. Assume the time is in GMT.)
Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here