Previous Next
0 / 15
Module DEMO-33-73DEMO-OOP-33

Age Category Parser

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Parse one raw age token and print whether the person is an adult or a minor. Handle invalid ages.

Input Format

Input is given as whitespace-separated raw tokens exactly in the order described by the problem statement.

Output Format

Print the exact success report or exact error message required by the problem.

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
20
Category: ADULT
Input: raw age = "20".
Derivation: 20 >= 18 is true, so category = "ADULT" | "Category: " + "ADULT" = "Category: ADULT".
Output:
Category: ADULT
Sample #2
Public sample
17
Category: MINOR
Input: raw age = "17".
Derivation: 17 >= 18 is false, so category = "MINOR" | "Category: " + "MINOR" = "Category: MINOR".
Output:
Category: MINOR

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings