import java.awt.*;
import java.applet.*;
import java.awt.event.*;

public class Cinema extends Applet implements ActionListener
{
    TextField ageField;
    int age;
    
    public void init()
    {
        Label title1;
        title1 = new Label("Enter Your Age:");
        add(title1);
        ageField = new TextField(3);
        add(ageField);
        ageField.addActionListener(this);
    }

    public void actionPerformed(ActionEvent event)
    {
        age = Integer.parseInt(ageField.getText());
        repaint();
    }

    public void paint(Graphics g)
    {
        g.drawString("1 normal adult ticket cost $10",50,50);
        g.drawString(" Your Age Is "+age,50,70);
        if (age<5)
            g.drawString("No charges for admission",50,90);
        else if(age<=12)
            g.drawString("Ticket is half price ($5)",50,90);
        else if(age<=54)
            g.drawString("Ticket is full price as mentioned above",50,90);
        else if(age>=55)
            g.drawString("For senior citizens,no charge",50,90);
        g.drawString("It is our pleasure to answer your enquiries",50,130);
        g.drawString("Do check our pricings regularly before coming to our Cinema,Thank You.",50,150);
    }
}

