Created
November 3, 2019 03:09
-
-
Save patrickcousins/0ea246388fcfb525e167cf81695deb95 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
fun calculateDiscount(person: Person) : Int { | |
return when { | |
person.age > 65 -> 20 | |
person.age < 13 -> 10 | |
person.income > 1_000_000 -> 0 | |
else -> 5 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment