Created
November 3, 2019 03:22
-
-
Save patrickcousins/43f2a1a545dce0aad7aa7fc20fce4ab8 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
//all the code below is in the file DiscountCalculator.kt | |
class DiscountCalculator { | |
//... | |
} | |
private fun Person.over65() : Boolean { | |
return this.age > 65 | |
} | |
private fun Person.under13() : Boolean { | |
return this.age < 13 | |
} | |
private fun Person.isRich() : Boolean { | |
return this.income > 1_000_000 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment