/**
 * TicketSales.java
 *
 * Demonstrates the use of conditional statements.
 * See TicketSalesFactored for a factored version.
 *
 * Computer Science S-111
 */

import java.util.Scanner;

public class TicketSales {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);                
        System.out.print("Enter your age: ");
        int age = console.nextInt();
        
        if (age < 25) {
            // handle people younger than 25
            System.out.print("orchestra or balcony? ");
            String choice = console.next();            
            
            int price;
            if (choice.equalsIgnoreCase("orchestra")) {
                price = 35;
            } else {
                price = 20;
            }
            System.out.println("The price is $" + price);
        } else {
            // handle people 25 and older
            System.out.print("orchestra or balcony? ");
            String choice = console.next();            
            
            int price;
            if (choice.equalsIgnoreCase("orchestra")) {
                price = 50;
            } else {
                price = 30;
            }
            System.out.println("The price is $" + price);
        }
    }
}
