Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PossibleUnitConverter
- {
- double final KILOMETERS = .001;
- double final CENTIMETERS = 100;
- double final MILES = .00062;
- double final INCHES = 39.37;
- String initialType;
- String endType;
- double initialValue;
- double baseValue;
- double endValue;
- public static void main (String[] args)
- {}
- public double toMeters()
- {
- if(initialType.equals("miles")) {
- baseValue = MILES*initialValue;
- }
- else if(start.equals("centimeters")) {
- baseValue = CENTIMETERS*initialValue;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement