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..3eea8be 100644 --- a/src/main/java/ConversionTool.java +++ b/src/main/java/ConversionTool.java @@ -3,19 +3,66 @@ public class ConversionTool { public static void main(String[] args){} - public static float CentimetersToInches(float centimeters){} + /* public float inches = 0f; + public float centimeters; + public float feet; + public float meters; + public float celsius; + public float fahrenheit; + public float mph; + public float kph;*/ - public static float InchesToCentimeters(float inches){} + public static float CentimetersToInches(float centimeters){ - public static float FeetToMeters(float feet){} + float inches = Math.max(0, centimeters) * (1f / 2.54f); - public static float MetersToFeet(float meters){} + return inches; - public static float CelsiusToFahrenheit(float celsius){} + } - public static float FahrenheitToCelsius(float fahrenheit){} + public static float InchesToCentimeters(float inches){ - public static float MphToKph(float mph){} + float centimeters = Math.max(0, inches) * 2.54f; - public static float KphToMph(float kph){} + return centimeters; + } + + public static float FeetToMeters(float feet){ + + float meters = Math.max(0, feet) * 0.3048f; + + return meters; + + } + + public static float MetersToFeet(float meters){ + + float feet = Math.max(0, meters) * 3.28084f; + return feet; + + } + + public static float CelsiusToFahrenheit(float celsius){ + + float fahrenheit = (celsius *(9f/5f)) + 32f; + return fahrenheit; + } + + public static float FahrenheitToCelsius(float fahrenheit){ + + float celsius = (fahrenheit - 32f) * (5f/9f); + return celsius; + } + + public static float MphToKph(float mph){ + + float kph = Math.max(0, mph) * 1.60934f; + return kph; + } + + public static float KphToMph(float kph){ + float mph = Math.max(0, kph) * 0.621371f; + return mph; + + } } diff --git a/target/classes/ConversionTool.class b/target/classes/ConversionTool.class index 7d20ebc..69b7342 100644 Binary files a/target/classes/ConversionTool.class and b/target/classes/ConversionTool.class differ