Question: Here is my code. It will print out hours, minutes, and seconds, but I am confused about how to proceed. 1.3: Convert seconds into hours

 Here is my code. It will print out hours, minutes, and
Here is my code. It will print out hours, minutes, and seconds, but I am confused about how to proceed. seconds, but I am confused about how to proceed. 1.3: Convert seconds

1.3: Convert seconds into hours (fractional) Next, you will add logic to your ConvertToHours program so that it will also convert the given number of seconds to a fractional number of hours. 1. Open your file named ConvertToHours.java. 2. Add code to your existing program so it does the following: a) Calculates the entered number of seconds to a fractional number of hours. b) Prints the fractional result to the console. Here is a test case with 5,322 seconds Output: Total seconds: 5322 Hours: 1 Minutes: 28 Seconds: 42 Fractional hours: 1.47833333 333 1 2 public class ConvertToHours { 30 public static void main (String[] args) 4 { 5 //type a number of seconds to convert into hours 6 var seconds = 600; 7 var minutes = seconds /60; 8 var hours = minutes / 60; 9 var remaniningSeconds = seconds % 60; 10 11 System.out.println(seconds + " Seconds is " + " " 12 + hours + " Hours and " + " " 13 + minutes + Minutes and + " " 14 + remaniningSeconds + " seconds " ); 15 16 17 } 18 } 11

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!