Kotlinlearncs.online LogoJava
Return to List

Solve: Age Group

Created By: Justin Maier
/ Version: 2024.7.0

Given an int variable age, print out the following messages depending on the value of age:

  • If age is less than 18, print "Child".
  • If age is 18 or greater, but less than 65, print "Adult".
  • If age is 65 or greater, print "Senior".
  • If the value of age does not represent a valid age, print "Invalid age".

Related Lessons

Stuck? You may find these lessons helpful: