Why my java output doesn't calculate the fraction that I input in the seconds and minutes fields?

Input:


import java.util.Scanner;

public class Biking {

public static void main(String[] args) {

Scanner input1 = new Scanner(System.in);
System.out.print("Enter the Seconds: ");
int seconds = input1.nextInt();
int hours1;
hours1 = (seconds / 3600) % 60;


Scanner input2 = new Scanner(System.in);
System.out.print("Enter the Minutes: ");
int minutes = input2.nextInt();
int hours2;
hours2 = ((minutes / 60) % 60) + (hours1);


Scanner input3 = new Scanner(System.in);
System.out.print("Enter the Hours: ");
int hours3 = input3.nextInt();
int totalhours = (hours1) + (hours2) + (hours3);

Scanner input4 = new Scanner(System.in);
System.out.print("Enter the miles that you have ridden: ");
int miles = input4.nextInt();
double MPH = miles / totalhours;

System.out.println("MPH: " + MPH);



Output:

Enter the Seconds: 45
Enter the Minutes: 45
Enter the Hours: 1
Enter the miles that you have ridden: 45
MPH45.0
BUILD SUCCESSFUL (total time: 7 seconds)

Report as