Skip to content

Instantly share code, notes, and snippets.

@alexaleluia12
Created October 19, 2023 12:22
Show Gist options
  • Save alexaleluia12/5fa6110c580f6fee86c330253fdff0a2 to your computer and use it in GitHub Desktop.
Save alexaleluia12/5fa6110c580f6fee86c330253fdff0a2 to your computer and use it in GitHub Desktop.
Google PlayGround
fun main() {
val morningNotification = 51
val eveningNotification = 135
printNotificationSummary(morningNotification)
printNotificationSummary(eveningNotification)
}
fun printNotificationSummary(numberOfMessages: Int) {
val notificationMessage = when {
numberOfMessages >= 100 -> "Your phone is blowing up! You have 99+ notifications."
else -> "You have $numberOfMessages notifications"
}
println(notificationMessage)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment