Categorizing life stages based on age

Report a typo

Write a function that takes a person's age as input and prints 'Minor' if their age is less than 18, 'Adult' if their age is greater than or equal to 18 and less than 65, and 'Senior' if their age is 65 or above.

Sample Input 1:

17

Sample Output 1:

Minor

Sample Input 2:

35

Sample Output 2:

Adult
Write a program in Kotlin
// Declare a function to determine age category based on the given age

fun main() {
// Read the person's age
val age = readLine()!!.toInt()

// Call the function with the age as argument

// Print the result
println()
}

Create a free account to access the full topic