From f98a0999a8e61e46d237ca6e6e7e5669c83a14e2 Mon Sep 17 00:00:00 2001 From: Aurora Banuelos Date: Sat, 13 May 2017 14:35:20 -0400 Subject: [PATCH] completed --- .idea/kotlinc.xml | 7 +++ .idea/vcs.xml | 6 +++ conversion.iml | 4 +- src/main/java/ConversionTool.java | 70 ++++++++++++++++++++++------ target/classes/ConversionTool.class | Bin 1471 -> 1311 bytes 5 files changed, 71 insertions(+), 16 deletions(-) create mode 100644 .idea/kotlinc.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..1c24f9a --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,7 @@ + + + + + \ 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 index 4b044f1..e0c2965 100644 --- a/conversion.iml +++ b/conversion.iml @@ -1,6 +1,6 @@ - + @@ -13,5 +13,7 @@ + + \ No newline at end of file diff --git a/src/main/java/ConversionTool.java b/src/main/java/ConversionTool.java index df73653..d77a0be 100644 --- a/src/main/java/ConversionTool.java +++ b/src/main/java/ConversionTool.java @@ -3,19 +3,59 @@ public class ConversionTool { public static void main(String[] args){} - public static float CentimetersToInches(float centimeters){} - - public static float InchesToCentimeters(float inches){} - - public static float FeetToMeters(float feet){} - - public static float MetersToFeet(float meters){} - - public static float CelsiusToFahrenheit(float celsius){} - - public static float FahrenheitToCelsius(float fahrenheit){} - - public static float MphToKph(float mph){} - - public static float KphToMph(float kph){} + public static float CentimetersToInches(float centimeters){ + if (centimeters < 0){ + return 0; + }else { + return (float) (centimeters * 0.393701); + } + } + + public static float InchesToCentimeters(float inches){ + if (inches < 0){ + return 0; + }else { + return (float) (inches * 2.54); + } + } + + public static float FeetToMeters(float feet){ + if (feet < 0){ + return 0; + }else { + return (float) (feet * 0.3048); + } + } + + public static float MetersToFeet(float meters){ + if (meters < 0){ + return 0; + }else { + return (float) (meters * 3.28084); + } + } + + public static float CelsiusToFahrenheit(float celsius){ + return (float)((celsius * (9.0/5.0)) + 32); + } + + public static float FahrenheitToCelsius(float fahrenheit){ + return (float) ((fahrenheit - 32) * (5.0/9.0)); + } + + public static float MphToKph(float mph){ + if (mph < 0){ + return 0; + }else { + return (float) (mph * 1.60934); + } + } + + public static float KphToMph(float kph){ + if (kph < 0){ + return 0; + }else { + return (float) (kph * 0.621371); + } + } } diff --git a/target/classes/ConversionTool.class b/target/classes/ConversionTool.class index 7d20ebc7517733b6c814cac4fcef422936d99bfb..719f595977efa7f95477f728451060c08a17b376 100644 GIT binary patch literal 1311 zcmaKs&rj4q6vy8{>8{-dRu%yf0oNbwg0hJ6Lox0KbQ9y^FB&eMN*&n3Zi}VM)p#(T zOgwq=;vXQ1CygeWa3L{z@<0eDHJ-eBF;U}p+6KB=veR@r^WOV@-prdxKmL3Bo`}xU z1%=vaOwMkP@R!>g59FM5`{$#cH+SUhmxo(BzaIaUb4oU?yu0#4&i?r%+GjbJgA`4g zLMLaxZg$__>~`er?+-hLjawLe|8~``Y`=)mc!VYx$(KyabT2b%Or_@-Nz?W{&Zwne zTKq<(JkK3XpD)4ETCfehG^abJm!!u1J$1LR zq_63jl5Q<#W?jd$7AL(ty0ZvnVjnlG)7)~+GIxR0>}!@$Vz4Cq z2+a=3urV{xsd>&_&7Sdaz${?ONcHEMExd^Kvw68ot7Zjx^Lo+YR*{=OwDjMn*?4R{a3#rlXi0pdRXl zMTiIS3UQ543JDqYA-fPJ>3ATVBFPiRld)&dsVTOee9}e@%TL!4=P#g{8ZnMwAyGU^ zh!>|5bkgIUs?U>Zc`e|@!E3GJ^#{CEeV$y)>j1A4ysj!ozieL8O xUBte}creWIk1>O74P#p)AzmCmE}u72pO>iRje|D<-o+~3IgiKaymyI4{{s`O<+}g? 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_