fixed conversion rates and added a few variables
This commit is contained in:
parent
c87937aba7
commit
f39457092e
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -3,6 +3,8 @@ package com.wyattjmiller.conversionapp
|
|||||||
class Conversion(euroResponse: Double = 0.0, kiloResponse: Double = 0.0) {
|
class Conversion(euroResponse: Double = 0.0, kiloResponse: Double = 0.0) {
|
||||||
private var euro: Double = 0.0
|
private var euro: Double = 0.0
|
||||||
private var kilo: Double = 0.0
|
private var kilo: Double = 0.0
|
||||||
|
private var dollar: Double = 0.0
|
||||||
|
private var mile: Double = 0.0
|
||||||
|
|
||||||
val euroToDollars: Double
|
val euroToDollars: Double
|
||||||
get() {
|
get() {
|
||||||
@ -14,9 +16,21 @@ class Conversion(euroResponse: Double = 0.0, kiloResponse: Double = 0.0) {
|
|||||||
return kilo.times(TO_MILES)
|
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 {
|
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_MILES: Double = 0.62137
|
||||||
|
const val TO_EURO: Double = 0.846956
|
||||||
|
const val TO_KILO: Double = 1.609344
|
||||||
}
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
Loading…
Reference in New Issue
Block a user