Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- String t1 = "23:59";
- String t2 = "11:43";
- System.out.println(LocalTime.parse(t2).isAfter(LocalTime.parse(t1)));
- //SpringApplication.run(Application.class, args);
- Map<String, Double> rates = new HashMap<>();
- rates.put("mm", 0.001);
- rates.put("cm", 0.01);
- rates.put("km", 1000D);
- rates.put("mi", 1609.344);
- rates.put("yd", 0.9144);
- rates.put("ft", 0.3048);
- rates.put("m", 1D);
- rates.put("ly", 9_460_730_472_580_800.00);
- Scanner scanner = new Scanner(System.in);
- String metric1 = scanner.nextLine();
- String metric2 = scanner.nextLine();
- double value = Double.parseDouble(scanner.nextLine());
- value = value * rates.get(metric1);
- value = value / rates.get(metric2);
- System.out.println(value);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement