005-005-006
Compound Conditions: Event Eligibility Check
Easy
Problem Description
Compound Conditions: Event Eligibility Check
In this problem, you will create a program that evaluates compound conditions combining age and membership status using logical operators (&&, ||) to determine event participation eligibility and displays the result to standard output.
Learning Objective: Understand how to perform checks combining multiple conditions using logical operators
Overview
Create a program that determines event participation eligibility based on age and membership status. Implement using logical operators (&&, ||).
Specifications
- Use variables
age(age) andisPremium(premium membership flag) - Eligibility conditions
- Age between 18 and 60 (inclusive) AND premium member
- OR age between 25 and 35 (inclusive) (membership status irrelevant)
- Test case 1: age=30, isPremium=false → "Eligible"
- Test case 2: age=65, isPremium=true → "Not eligible"
Output Format
Age: 30, Premium: false
Eligible
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
