Answer:
Explanation:
public class time {
public static void main (String[]args) {
//Step 1 we declare the variables
int hours, minutes, seconds;
hours = 17;
minutes = 12;
seconds = 00;
//For checking
System.out.println(hours+":"+minutes+":"+seconds);
//Step 2 we make the operation for the seconds since midnight
int secSinceMidNite;
secSinceMidNite = ((hours*60)+minutes)*60 + seconds;
System.out.println("Seconds since midnight = "+secSinceMidNite);
//Step 3 we make the operation for the seconds remaining in day
int secRemainingInDay, totalSecInDay;
totalSecInDay = 24*60*60;
secRemainingInDay = totalSecInDay - secSinceMidNite;
System.out.println("Seconds remaining in day = "+secRemainingInDay);
//Step 4 in the operation for percentage of day that has passed
int percentOfDayPassed;
percentOfDayPassed = (secSinceMidNite*100)/totalSecInDay;
System.out.println("Percentage of day that has passed = " +percentOfDayPassed+"%");
}
}