Question: JAVA. Modify the Time2 class (below) to implement the time as the number of seconds since midnight. The class should have one data field (an
JAVA. Modify the Time2 class (below) to implement the time as the number of seconds since midnight. The class should have one data field (an int with the number of seconds since midnight) instead of three. This change should not affect the arguments , behavior , or output of the public methods . Create a Driver class with a main method to test your Time2 class . This program should ask the user to input the number of hours, minutes, and seconds past midnight, creating a Time2 object and using the mutator methods . The program should then use the toString() method to print out the time. https://pastebin.com/LJx0ggJW **My working code: https://pastebin.com/jGKAHuKz** Errors:

My code isn't displaying the time like in the expected result
CODELAB ANALYSIS: LOGICAL ERROR(S) Problems Detected: The contents of your standard output is incorrect. Given the following was entered from the keyboard: you displayed: Enter hours Enter minutes: Enter seconds instead of: Enter hours: Enter Enter seconds 12:00:00 AM Failed 4 out of 4 test runs. Failed Test Run #1 The contents of your standard output is incorrect. Interactive Session W Hide Invisibles Highlight: None Expected Result: Your Code's Actual Result: Enter hours 23. Enter minutes :59.* Ente r. hours :2 Enter minutes :59 Enter seconds:59 11:59:59 PM Enter seconds :59 Print Content Results Support Show Highlighted only
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
