Roller coasters!

Report a typo

You decided to automate the process of controlling the access to a roller coaster. For this purpose, you wrote a function checkHeight(height: Int). If a person's height is less than 145cm or more than 210cm, they can't enter the roller coaster.

If a person can enter the roller coaster, checkHeight should print "You can go!" on a new line; otherwise, if their height doesn't fit, it prints "Sorry, not today".

Sample Input 1:

150 144 220 170

Sample Output 1:

You can go!
Sorry, not today
Sorry, not today
You can go!
Write a program in Kotlin
fun checkHeight(iterator: Iterator<Int>) {
// write your code here
}

fun main() {
val list = readln().split(" ").map(Integer::parseInt).toList()
checkHeight(list.iterator())
}
___

Create a free account to access the full topic