002-004-012

Multi-Condition Input Validation

Hard

Problem Description

Multi-Condition Input Validation

In this problem, you will create a program that reads two integers (age and height) using Scanner, validates each value against specified ranges using multiple conditions, and displays the result ("Valid" or "Invalid") to standard output.

Learning Objective: Implement input checking that combines multiple validation conditions

Overview

Read age and height (cm) from the user, validate against multiple conditions, and output the result.

Specifications

  • Read age and height using Scanner (two integers)
  • Output "Valid" if age is 0-120 AND height is 50-250
  • Output "Invalid" if either value is outside its range

Input Format

25
170

Output Format

Valid

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up