Skip to content

Instantly share code, notes, and snippets.

@cassiozen
Created November 28, 2018 23:53
Show Gist options
  • Save cassiozen/bb0377f02f564c9912d989b6137e97ad to your computer and use it in GitHub Desktop.
Save cassiozen/bb0377f02f564c9912d989b6137e97ad to your computer and use it in GitHub Desktop.
when(selectedFruit) {
"orange" -> print("Oranges are 59 cents a pound.")
"apple" -> print("Apples are 32 cents a pound.")
"cherry" -> print("Cherries are one dollar a pound.")
"mango", "papaya" -> print("Mangoes and papayas are 3 dollars a pound.")
else -> print("Sorry, we are out of $selectedFruit.")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment