Created
November 3, 2019 03:29
-
-
Save patrickcousins/41a560077b0498d943c678f7b6de796c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fun calculateDiscount(person: Person) : Int { | |
return when { | |
over65(person) -> 20 | |
under13(person) -> 10 | |
isRich(person) -> 0 | |
else -> 5 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment