Created
August 29, 2017 19:55
-
-
Save jifferon/0ad50de3099323bb7b84c9cd41c05ef3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class Good( | |
val name: String, | |
val saleAmount: Int, | |
val price: Int | |
) { | |
/** | |
* Method to get current price with sale | |
*/ | |
fun calculatePrice(): Int { | |
return price - price*saleAmount/100 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment