diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..5966089 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +conversion \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 3c5f7fa..7ec525c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,27 +1,11 @@ - - - - - - - - - - - - - - - - + - diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf3..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index dfca8c4..b17172c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,8 +1,5 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + 1.8 @@ -37,6 +46,17 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/vcs.xml similarity index 51% rename from .idea/encodings.xml rename to .idea/vcs.xml index 97626ba..35eb1dd 100644 --- a/.idea/encodings.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - - + + \ No newline at end of file diff --git a/conversion.iml b/conversion.iml index 4b044f1..d4f21b5 100644 --- a/conversion.iml +++ b/conversion.iml @@ -5,7 +5,6 @@ - diff --git a/src/main/java/ConversionTool.java b/src/main/java/ConversionTool.java index df73653..a62f5b9 100644 --- a/src/main/java/ConversionTool.java +++ b/src/main/java/ConversionTool.java @@ -1,21 +1,71 @@ public class ConversionTool { - public static void main(String[] args){} + public static void main(String[] args) { + } - public static float CentimetersToInches(float centimeters){} + public static float CentimetersToInches(float centimeters) { - public static float InchesToCentimeters(float inches){} + if(centimeters < 0){ + return 0; + } - public static float FeetToMeters(float feet){} + return centimeters / 2.54f; + } - public static float MetersToFeet(float meters){} - public static float CelsiusToFahrenheit(float celsius){} + public static float InchesToCentimeters(float inches){ - public static float FahrenheitToCelsius(float fahrenheit){} + if (inches < 0){ + return 0; + } - public static float MphToKph(float mph){} + return inches * 2.54f; + } - public static float KphToMph(float kph){} + public static float FeetToMeters(float feet){ + + if(feet < 0){ + return 0; + } + + return feet / 3.28f; + } + + public static float MetersToFeet(float meters){ + + if(meters < 0){ + return 0; + } + + return meters * 3.28084f; + } + + public static float CelsiusToFahrenheit(float celsius){ + + return (celsius * 1.8f) + 32f; + } + + public static float FahrenheitToCelsius(float fahrenheit){ + + return (fahrenheit -32f) * .5556f; + } + + public static float MphToKph(float mph){ + + if (mph < 0){ + return 0; + } + + return mph * 1.60934f; + } + + public static float KphToMph(float kph){ + + if (kph < 0){ + return 0; + } + + return kph * .6214f; + } } diff --git a/target/classes/ConversionTool.class b/target/classes/ConversionTool.class index 7d20ebc..7235336 100644 Binary files a/target/classes/ConversionTool.class and b/target/classes/ConversionTool.class differ