From f57a5768f84da390fa0532c6e415e3a4a5b79f0b Mon Sep 17 00:00:00 2001 From: Justin Haas Date: Sat, 13 May 2017 21:57:47 -0400 Subject: [PATCH 1/2] started lab --- .idea/.name | 1 + .idea/compiler.xml | 32 ------------------ .idea/copyright/profiles_settings.xml | 3 -- .idea/encodings.xml | 6 ---- .idea/misc.xml | 48 +++++++++++++++++++-------- .idea/modules.xml | 8 ----- conversion.iml | 17 ---------- src/main/java/ConversionTool.java | 6 +++- 8 files changed, 40 insertions(+), 81 deletions(-) create mode 100644 .idea/.name delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/copyright/profiles_settings.xml delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/modules.xml delete mode 100644 conversion.iml 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 deleted file mode 100644 index 3c5f7fa..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file 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/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +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/modules.xml b/.idea/modules.xml deleted file mode 100644 index 9a54969..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/conversion.iml b/conversion.iml deleted file mode 100644 index 4b044f1..0000000 --- a/conversion.iml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/ConversionTool.java b/src/main/java/ConversionTool.java index df73653..45822b3 100644 --- a/src/main/java/ConversionTool.java +++ b/src/main/java/ConversionTool.java @@ -3,7 +3,11 @@ public class ConversionTool { public static void main(String[] args){} - public static float CentimetersToInches(float centimeters){} + public static float CentimetersToInches(float centimeters){ + + + + } public static float InchesToCentimeters(float inches){} From 185a8b69ad0ef40e6c66efda312e44711408e115 Mon Sep 17 00:00:00 2001 From: Justin Haas Date: Sat, 13 May 2017 22:40:21 -0400 Subject: [PATCH 2/2] finished conversion tool --- .idea/compiler.xml | 16 +++++++ .idea/modules.xml | 8 ++++ .idea/vcs.xml | 6 +++ conversion.iml | 16 +++++++ src/main/java/ConversionTool.java | 64 ++++++++++++++++++++++++---- target/classes/ConversionTool.class | Bin 1471 -> 1240 bytes 6 files changed, 101 insertions(+), 9 deletions(-) create mode 100644 .idea/compiler.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 conversion.iml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..7ec525c --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..9a54969 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/conversion.iml b/conversion.iml new file mode 100644 index 0000000..d4f21b5 --- /dev/null +++ b/conversion.iml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/ConversionTool.java b/src/main/java/ConversionTool.java index 45822b3..a62f5b9 100644 --- a/src/main/java/ConversionTool.java +++ b/src/main/java/ConversionTool.java @@ -1,25 +1,71 @@ public class ConversionTool { - public static void main(String[] args){} + public static void main(String[] args) { + } + + public static float CentimetersToInches(float centimeters) { + + if(centimeters < 0){ + return 0; + } + + return centimeters / 2.54f; + } + + + public static float InchesToCentimeters(float inches){ + + if (inches < 0){ + return 0; + } + + return inches * 2.54f; + } - public static float CentimetersToInches(float centimeters){ + 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 InchesToCentimeters(float inches){} + public static float FahrenheitToCelsius(float fahrenheit){ - public static float FeetToMeters(float feet){} + return (fahrenheit -32f) * .5556f; + } - public static float MetersToFeet(float meters){} + public static float MphToKph(float mph){ - public static float CelsiusToFahrenheit(float celsius){} + if (mph < 0){ + return 0; + } - public static float FahrenheitToCelsius(float fahrenheit){} + return mph * 1.60934f; + } - public static float MphToKph(float mph){} + public static float KphToMph(float kph){ - 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 7d20ebc7517733b6c814cac4fcef422936d99bfb..7235336ccdfdeeef4100a96fcb0ea67e8aff6097 100644 GIT binary patch literal 1240 zcmaKq%Wl&^6o$_)w2%ncfKrjth^UAZglcsI8^=tN35i`fPTznv zJ61eHC00l*cmSln01v>1Cty?Yk8L$Jsbb0FnRCwnoy+*=+4mnr^nfZUO4F9IQ~dN! z*?IHlBbL8=O8s}IqwFF;spo2^O8xZgmr`FXXi2)4r2C8#+rkp=Q%12;`H+#)u-|h= z3oT*sSL0!uJG#*xz@oKm(-<5Yj*#cTsJJ~bVsxq1u&rb6jD&6JwmqnUGc<(7XtDIR z)i;if>cFtN)dSZNR=4KmF`O=x`3u~zHn`=AA$Nh)?H88WmqXiNmUOp|k0xA#39FdZBjW&E>lOE04RY+mlcNQ{xUY4jX!^|*jLX>!jB|HLd4 z2G&$36s+za^>q8?Q4d2M%2mZ41$c%Ja!noBW5?u8At#%U4zD8Tm7xq}8ReobOnNfR z*X=$xU0Nr3?ea+xx}q%B98Ohy8NTt&Z^XW0Ge-+p6P^(u>@$7qsMo*<$+h7mBA(irSoY0)wADM=?*3K(Q)Hom7#fYjoZ7 z-IxjM{}0Qfr2=3}5!iA7TbTumO;xrG*a~245!lTDwmJ)@OjWi4*d4&i5!hM)TR(?A z3}&VlwRm4kv?m?oduhpf;|Il7qI6MSjmGi%uD_*oBsf<=)qF} literal 1471 zcmZva%}x_h6vxlBx1DJ_r8reUP(BJ`i$Z~DVgdoAP-7?%Wr7P`IIUAUwVffuz!SK0 z;lj8xMqj|hmBxjxHSslk1~(f2cVs z#nPcbtYSUW1K#~=n$^%chnj8hyKiJp%Qz8euvW3mGu=KhEK{|t z&I)w8nqdkwRD4`(YiC-yqnStL1IISZqZOB<*+D2Xbi}e^ zwNw=-)95(`5@1Q#nqydK#qcBZUW#f3bOe&Cy6&jft}6?J2Eu-fy*JtYdRuQeG=(3K#WVB2fCS269mK7SUBI50`%JC{rRh*{Of*x@jSoxZ_