The purpose of the program is to take 4 user inputed integers (days, hours, minutes, and seconds) and output them as a floating point doubles to show the maximum amount of time possible for each. For example I input 2 days, 10 hours, 45 minutes, 20 seconds and it outputs 2.448148148148 days, 58.7775 hours, 3525.33333 mins, 211520 seconds. I got the program almost working but I do not know how to get the days, hours, and minutes to show the remainder.
import java.util.Scanner;
public class TimeTotalsCalc
{
public static void main(String[] args)
{
int days, hours, mins, seconds, time = 60, hours_In_Day = 24, daysOut, hoursOut, minsOut, secsOut;
Scanner keyboard = new Scanner(System.in);
System.out.println("Give me a value in days, minutes, hours and seconds");
System.out.println("and I will show the total time possible for each.");
System.out.println("");
System.out.print("Please enter the number of days: ");
days = keyboard.nextInt();
System.out.print("Please enter the number of hours: ");
hours = keyboard.nextInt();
System.out.print("Please enter the number of minutes: ");
mins = keyboard.nextInt();
System.out.print("Please enter the number of seconds: ");
seconds = keyboard.nextInt();
daysOut = (days);
hoursOut = ((days * hours_In_Day) + hours);
minsOut = ((days * hours_In_Day * time) + (hours * time) + (mins));
secsOut = ((days * hours_In_Day * time * time) + (hours * time * time) + (mins * time) + seconds);
System.out.println();
System.out.println("We can represent the time you entered as any of the following: ");
System.out.println((double)daysOut + " days(s)");
System.out.println((double)hoursOut + " hour(s)");
System.out.println((double)minsOut + " minute(s)");
System.out.println(secsOut + " seconds(s)");
keyboard.close();
}
}