Advertisement
Guest User

Main

a guest
Oct 1st, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. package dailyprogrammer.medium.averagespeedcameras;
  2.  
  3. import java.io.File;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String... args) throws Exception {
  8.         File logFile = new File("src/dailyprogrammer/medium/averagespeedcameras/input");
  9.         SpeedCalculator calc = new SpeedCalculator();
  10.         calc.getSpeedingCars(logFile).forEach(pair -> {
  11.             String car   = pair.key;
  12.             double speed = pair.value;
  13.             System.out.printf("Vehicle %s broke the speed limit by %s %s.\n", car, String.format("%1$,.2f", speed), calc.getDistString());
  14.         });
  15.     }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement