diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/wyattjmiller/conversionapp/Conversion.kt b/app/src/main/java/com/wyattjmiller/conversionapp/Conversion.kt index 0382140..6a06bd5 100644 --- a/app/src/main/java/com/wyattjmiller/conversionapp/Conversion.kt +++ b/app/src/main/java/com/wyattjmiller/conversionapp/Conversion.kt @@ -3,6 +3,8 @@ package com.wyattjmiller.conversionapp class Conversion(euroResponse: Double = 0.0, kiloResponse: Double = 0.0) { private var euro: Double = 0.0 private var kilo: Double = 0.0 + private var dollar: Double = 0.0 + private var mile: Double = 0.0 val euroToDollars: Double get() { @@ -14,9 +16,21 @@ class Conversion(euroResponse: Double = 0.0, kiloResponse: Double = 0.0) { return kilo.times(TO_MILES) } + val milesToKilos: Double + get() { + return mile.times(TO_KILO) + } + + val dollarsToEuros: Double + get() { + return dollar.times(TO_EURO) + } + companion object { - const val TO_DOLLARS: Double = 0.846956 + const val TO_DOLLARS: Double = 1.184632 const val TO_MILES: Double = 0.62137 + const val TO_EURO: Double = 0.846956 + const val TO_KILO: Double = 1.609344 } init {