We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb4f767 commit 7145881Copy full SHA for 7145881
Train.java
@@ -13,7 +13,7 @@ public static void main (String [] args)
13
int v2 = scan.nextInt();
14
System.out.println ("Please enter the time of train 2:");
15
int t2 = scan.nextInt();
16
- int dis = Math.abs(((t1 / 60) * v1) - ((t2 / 60) * v2));
17
- Systen.out.println (" The distance between the trains is " + dis + "km");
+ double dis = Math.abs(((t1 / 60.0) * v1) - ((t2 / 60.0) * v2));
+ System.out.println (" The distance between the trains is " + dis + " km");
18
} // end of method main
19
} //end of class Train
0 commit comments