Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. public class PossibleUnitConverter
  2. {  
  3.    double final KILOMETERS = .001;
  4.    double final CENTIMETERS = 100;
  5.    double final MILES = .00062;
  6.    double final INCHES = 39.37;
  7.    String initialType;
  8.    String endType;
  9.    double initialValue;
  10.    double baseValue;
  11.    double endValue;
  12.    
  13.    
  14.    public static void main (String[] args)
  15.    {}
  16.    
  17.    public double toMeters()
  18.    {
  19.      if(initialType.equals("miles")) {
  20.        baseValue = MILES*initialValue;
  21.      }
  22.      else if(start.equals("centimeters")) {
  23.        baseValue = CENTIMETERS*initialValue;
  24.      }
  25.    }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement