0

Help me

fun main(args: Array<String>) { var age = readLine()!!.toInt() //var Child=0-11 //var Teen=12-17 //var Adult=18-64 //var Senior= 65 var age=42 if(Child<=age && Teen<=age) print("Invalid age"){ if(Adult==age && Senior>=age) print("Adult") } }

27th Jun 2021, 7:54 PM
время Ч
2 Respuestas
0
As the input data is age, you need to output the age group according to the following category: Child: 0-11 Teens: 12 - 17 years old Adult: 18–64 Senior: 65+ If the age is negative, you need to output "Invalid Age". Example Input Data: 42 Sample Output Data: Adult 
27th Jun 2021, 7:55 PM
время Ч
0
// assuming Kotlin as target language: var age = readLine()!!.toInt() if (age < 0) { print("Invalid Age") } else if (age < 12) { print("Child") } else if (age < 18) { print("Teen") } else if (age < 75) { print("Adult") } else { print("Senior") }
27th Jun 2021, 9:15 PM
visph
visph - avatar