From 69260aeebd721e8068e0d2b258e79322b9c6401e Mon Sep 17 00:00:00 2001 From: Brian Mullin Date: Fri, 12 May 2017 14:49:32 -0400 Subject: [PATCH 1/2] Halfway --- .idea/.name | 1 + .idea/compiler.xml | 18 +-------- .idea/copyright/profiles_settings.xml | 3 -- .idea/misc.xml | 48 +++++++++++++++------- .idea/{encodings.xml => vcs.xml} | 4 +- conversion.iml | 1 - src/main/java/ConversionTool.java | 55 ++++++++++++++++++++++---- target/classes/ConversionTool.class | Bin 1471 -> 1230 bytes 8 files changed, 85 insertions(+), 45 deletions(-) create mode 100644 .idea/.name delete mode 100644 .idea/copyright/profiles_settings.xml rename .idea/{encodings.xml => vcs.xml} (51%) 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..445a049 100644 --- a/src/main/java/ConversionTool.java +++ b/src/main/java/ConversionTool.java @@ -3,19 +3,58 @@ 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){ + return 1; + } + + public static float FahrenheitToCelsius(float fahrenheit){ + return 1; + } + + public static float MphToKph(float mph){ + return 1; + } + + public static float KphToMph(float kph){ + return 1; + } } diff --git a/target/classes/ConversionTool.class b/target/classes/ConversionTool.class index 7d20ebc7517733b6c814cac4fcef422936d99bfb..9bbedded0a19183a15aff22fe25b54e9c3237391 100644 GIT binary patch literal 1230 zcma))%Wl&^6o&tCol6~)UIKwqE^P|MX-fhuSWpyI3bH^XAXKXx*f?PtPe|;_aVp+| z1zVm0i4}+itl^E=AkK`fCKjobNEy%h&-uSIbL`)LzyAPmANLI8VHv1mM{oT4xUC;l zKD^NzpNc>AgI9l^=CGT?9z*uA@I};MSg@)`40!wwG}w=*DRwH0*T z!I2vZ87HD1d1Az{+-e5?DGx^?@SPwS>=S3`3ZJ2Dy>9j0Q@1{F{a*br3WeX>SAE>D zN6ylWG^tJQM`Fk$LOQ`Szw2?T)h)YfGZea$Bm*NQE0T&*TS(0{V^nZmfYp;9ZfSDP<4Kh?x!1XiWwd91?&jV&>04)MmQ$UG{ zPbksygg4HBdlbvzYvyEh@oTFoM*P||+)Nl7b2uNQoSTWWGKceF%DI&|Z_VL+lycry LPKIrHGu-(Hv`x1o 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_ Date: Fri, 12 May 2017 15:00:41 -0400 Subject: [PATCH 2/2] FILE DONE --- src/main/java/ConversionTool.java | 16 ++++++++++++---- target/classes/ConversionTool.class | Bin 1230 -> 1345 bytes 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/ConversionTool.java b/src/main/java/ConversionTool.java index 445a049..3eea8be 100644 --- a/src/main/java/ConversionTool.java +++ b/src/main/java/ConversionTool.java @@ -43,18 +43,26 @@ public static float MetersToFeet(float meters){ } public static float CelsiusToFahrenheit(float celsius){ - return 1; + + float fahrenheit = (celsius *(9f/5f)) + 32f; + return fahrenheit; } public static float FahrenheitToCelsius(float fahrenheit){ - return 1; + + float celsius = (fahrenheit - 32f) * (5f/9f); + return celsius; } public static float MphToKph(float mph){ - return 1; + + float kph = Math.max(0, mph) * 1.60934f; + return kph; } public static float KphToMph(float kph){ - return 1; + float mph = Math.max(0, kph) * 0.621371f; + return mph; + } } diff --git a/target/classes/ConversionTool.class b/target/classes/ConversionTool.class index 9bbedded0a19183a15aff22fe25b54e9c3237391..69b7342cbe8e332db3b2e16497baf896374197a2 100644 GIT binary patch literal 1345 zcmZ{iK~EDw6vzLw3~kxg0y&P7cgc23{1zU( z`WZ|-X*}pz6Tg6G<9F~vd^5YDUD!6+*_r=)|KEFkJ3o)Vegm+Ebsgt$TgM8DeCx;i zMZTST_lj?QNPp+sFaAB|rN4~^-=S1qNqMQ$yA-X+1@u@OP&Lfdrhm$Fi|Z#_K|SAmSY=^)7~IX z$FyvQsr<`o%RDlRZPPv|?s=|dA8e>Prh7onY($vUvamg?BRoPH&J(-d6qL*Jl|qFf zS?>oK7%4F;$jJJshBM%2NL7UJ3};v22-Bb=nS4Bj{ea=fG*!FZwR%*yVm4i2H-$xN zye^c=pf?8OY(Ga94N?-jhfTwIdf23)cGUVtt_f184Y}3#oSs`36-!Pw8y?<@oL35I zjK^^&g}b=NkPfHN#QQ^iUTcXuwV3WpyQZgVn{OFL^A#E!=8>X%B7Zt47vr=}(5Xmo zM(@$3&tRWuqhXTPm=fu$(>~=VAdB;K8p8!lks{5@^hom=BOfp_T*M`1oW|wASf(-> zX~|^n3$)Bg>(RnTI{LMB6`G_AgI9l^=CGT?9z*uA@I};MSg@)`40!wwG}w=*DRwH0*T z!I2vZ87HD1d1Az{+-e5?DGx^?@SPwS>=S3`3ZJ2Dy>9j0Q@1{F{a*br3WeX>SAE>D zN6ylWG^tJQM`Fk$LOQ`Szw2?T)h)YfGZea$Bm*NQE0T&*TS(0{V^nZmfYp;9ZfSDP<4Kh?x!1XiWwd91?&jV&>04)MmQ$UG{ zPbksygg4HBdlbvzYvyEh@oTFoM*P||+)Nl7b2uNQoSTWWGKceF%DI&|Z_VL+lycry LPKIrHGu-(Hv`x1o