Skip to content

Commit 7145881

Browse files
authored
Update Train.java
1 parent fb4f767 commit 7145881

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Train.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static void main (String [] args)
1313
int v2 = scan.nextInt();
1414
System.out.println ("Please enter the time of train 2:");
1515
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");
16+
double dis = Math.abs(((t1 / 60.0) * v1) - ((t2 / 60.0) * v2));
17+
System.out.println (" The distance between the trains is " + dis + " km");
1818
} // end of method main
1919
} //end of class Train

0 commit comments

Comments
 (0)