Facebook
From Adrian Pietrzak, 5 Years ago, written in Java.
Embed
Download Paste or View Raw
Hits: 185
  1. package com.company;
  2.  
  3. /**
  4.  * Konwerter prędkości
  5.  */
  6. class VelocityConverter {
  7.  
  8.     private static final double KMH_PER_MILE = 1.6;
  9.  
  10.     public double convertToKmh(double miles) {
  11.         return miles * KMH_PER_MILE;
  12.     }
  13. }
  14.  
  15. public class Main {
  16.     public static void main(String[] args) {
  17.         VelocityConverter converter = new VelocityConverter();
  18.  
  19.         System.out.println(converter.convertToKmh(2.0));
  20.     }
  21. }