005-003-003
Nested If Statements: Ticket Price Determination
Medium
Problem Description
Nested If Statements: Ticket Price Determination
In this problem, you will create a program that receives age and member flag as input, determines the ticket price using nested if statements, and displays the result to standard output.
Learning Objective: Implement complex conditional branching with nested if statements
Determine movie theater ticket prices. Price varies by age and membership status.
Price Table
- Adult (18+): Member 1500 yen, General 1800 yen
- Child (under 18): Member 800 yen, General 1000 yen
Input
Line 1: Age (integer)
Line 2: Member flag (1=member, 0=general)
Output
Age: [age] years
Category: [Adult/Child]
Price: [amount] yen
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