Guest User

Untitled

a guest
Jan 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. /*
  2. Demo of nested if -else and compound condtions.
  3. Try changing the temperature to different numbers and sunny to false to see the message change
  4. */
  5. fun main(args:Array<String>) {
  6. val temperature = 65
  7. val sunny = false
  8. if (temperature >= 65 && temperature < 75)
  9. {
  10. if (sunny)
  11. {
  12. println("Go for a run!")
  13. }
  14. else
  15. {
  16. println("OK to run, but do not get wet!")
  17. }
  18. }
  19. else
  20. {
  21. println("Stay in, perhaps the gym?")
  22. }
  23. }
Add Comment
Please, Sign In to add comment