17. Age Category

Given an integer age. Write a function string AgeCategory(int age) that returns an age category: "child" for ages under 12, "teenager" for ages 12 to 17, "adult" for ages 18 to 64, "senior" for ages 65 and above.
Example 1
Input: age = 70
Output: "пенсионер"
Explanation: 70 years is greater than or equal to 65, so this is a retiree
Example 2
Input: age = 8
Output: "ребенок"
Explanation: 8 years is less than 12, so this is a child
Example 3
Input: age = 15
Output: "подросток"
Explanation: 15 years falls within the 12-17 age range
easystrings
JavaScript
Loading...
Line 1, Char 1