I am trying to make a program that will tell how much a ticket costs and what the admission status is for a movie based on the age of the person. For ages 1-4 and 55 and up, it is $0.00 and "Free". For ages 5-12 it is $4.25 and "Child". And for ages 13-54 it is $8.50 and "Adult". Everything seems to working properly, except when I enter an age, no matter what the age, it says "Free" under Admission. The ticket price is always correct, it is only the Admission that is not working. What might be the problem?

//import statements
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.text.*;

public class CinemaPrice extends JFrame 
{

   //declaration section
   Color white = new Color(255, 255, 255);
   Color black = new Color(0, 0, 0);

   JLabel patronAgeJLabel;
   JTextField patronAgeJTextField;

   JLabel ticketPriceJLabel;
   JTextField ticketPriceJTextField;

   JLabel admissionJLabel;
   JTextField admissionJTextField;

   DecimalFormat currency;

   JButton enterJButton;
   JButton clearJButton;
   JButton closeJButton;

   int patronAge;
   double ticketPrice;
   String admission;
   double freeTicket;
   double childTicket;
   double adultTicket;
   String freeAdmission;
   String childAdmission;
   String adultAdmission;

      public CinemaPrice()
      {
         createUserInterface();
      }
      public void createUserInterface()
      {
      Container contentPane = getContentPane();
      contentPane.setBackground(white);
      contentPane.setLayout(null);

      patronAgeJLabel = new JLabel();
        patronAgeJLabel.setBounds(50, 50, 120, 20);
        patronAgeJLabel.setFont(new Font("Default", Font.PLAIN, 12));
        patronAgeJLabel.setText("Enter Patron's Age");
        patronAgeJLabel.setForeground(black);
        patronAgeJLabel.setHorizontalAlignment(JLabel.RIGHT);
        contentPane.add(patronAgeJLabel);

        patronAgeJTextField = new JTextField();
        patronAgeJTextField.setBounds(200, 50, 50, 20);
        patronAgeJTextField.setFont(new Font("Default", Font.PLAIN, 12));
        patronAgeJTextField.setHorizontalAlignment(JTextField.CENTER);
        patronAgeJTextField.setForeground(black);
        patronAgeJTextField.setBackground(white);
        patronAgeJTextField.setEditable(true);
        contentPane.add(patronAgeJTextField);

      ticketPriceJLabel = new JLabel();
      ticketPriceJLabel.setBounds(50, 100, 120, 20);
      ticketPriceJLabel.setFont(new Font("Default", Font.PLAIN, 12));
      ticketPriceJLabel.setText("Ticket Price");
      ticketPriceJLabel.setForeground(black);
      ticketPriceJLabel.setHorizontalAlignment(JLabel.RIGHT);
      contentPane.add(ticketPriceJLabel);

      ticketPriceJTextField = new JTextField();
      ticketPriceJTextField.setBounds(200, 100, 50, 20);
      ticketPriceJTextField.setFont(new Font("Default", Font.PLAIN, 12));
      ticketPriceJTextField.setHorizontalAlignment(JTextField.CENTER);
      ticketPriceJTextField.setForeground(black);
      ticketPriceJTextField.setBackground(white);
      ticketPriceJTextField.setEditable(false);
      contentPane.add(ticketPriceJTextField);

      admissionJLabel = new JLabel();
      admissionJLabel.setBounds(50, 150, 120, 20);
      admissionJLabel.setFont(new Font("Default", Font.PLAIN, 12));
      admissionJLabel.setText("Admission");
      admissionJLabel.setForeground(black);
      admissionJLabel.setHorizontalAlignment(JLabel.RIGHT);
      contentPane.add(admissionJLabel);

      admissionJTextField = new JTextField();
      admissionJTextField.setBounds(200, 150, 100, 20);
      admissionJTextField.setFont(new Font("Default", Font.PLAIN, 12));
      admissionJTextField.setHorizontalAlignment(JTextField.CENTER);
      admissionJTextField.setForeground(black);
      admissionJTextField.setBackground(white);
      admissionJTextField.setEditable(false);
      contentPane.add(admissionJTextField);

      enterJButton = new JButton();
        enterJButton.setBounds(25, 300, 100, 20);
        enterJButton.setFont(new Font("Default", Font.PLAIN, 12));
        enterJButton.setText("Enter");
        enterJButton.setForeground(black);
        enterJButton.setBackground(white);
        contentPane.add(enterJButton);
        enterJButton.addActionListener(

         new ActionListener()
            {
                public void actionPerformed(ActionEvent event)
                {
                    enterJButtonActionPerformed(event);
                }
            }
        );

      clearJButton = new JButton();
        clearJButton.setBounds(150, 300, 100, 20);
        clearJButton.setFont(new Font("Default", Font.PLAIN, 12));
        clearJButton.setText("Clear");
        clearJButton.setForeground(black);
        clearJButton.setBackground(white);
        contentPane.add(clearJButton);
        clearJButton.addActionListener(


         new ActionListener()
            {
                public void actionPerformed(ActionEvent event)
                {
                    clearJButtonActionPerformed(event);
                }
            }
        );

      closeJButton = new JButton();
        closeJButton.setBounds(275, 300, 100, 20);
        closeJButton.setFont(new Font("Default", Font.PLAIN, 12));
        closeJButton.setText("Close");
        closeJButton.setForeground(black);
        closeJButton.setBackground(white);
        contentPane.add(closeJButton);
        closeJButton.addActionListener(

         new ActionListener()
            {
                public void actionPerformed(ActionEvent event)
                {
                    closeJButtonActionPerformed(event);
                }
            }
        );

      setTitle("Cinema Price");
      setSize(400, 400);
      setVisible(true);
      }

      //main method
      public static void main(String[] args)
      {
         CinemaPrice application = new CinemaPrice();
         application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      }

      public void enterJButtonActionPerformed(ActionEvent event)
       {
      try
      {
         patronAge = Integer.parseInt(patronAgeJTextField.getText());
         checkPatronAge();
      }
      catch(NumberFormatException exception)
      {
         JOptionPane.showMessageDialog(this,
         "Please Enter Patron's Age!",
         "Number Format Error", JOptionPane.ERROR_MESSAGE );
         patronAgeJTextField.setText("");
         patronAgeJTextField.requestFocusInWindow();
      }
   }

   public void checkPatronAge()
   {
      if (patronAge == 0)
      {
         JOptionPane.showMessageDialog(this,
         "Please Enter a Number Greater Than 0!",
         "Number Format Error", JOptionPane.ERROR_MESSAGE );
         patronAgeJTextField.setText("");
         ticketPriceJTextField.setText("");
         patronAgeJTextField.requestFocusInWindow();
      } 
      else
      {
         calculateTicketPrice();
         determineAdmissionStatus();
      } 
   }


   public void calculateTicketPrice()
      {
         currency = new DecimalFormat("$0.00");
         freeTicket = 0.00;
         childTicket = 4.25;
         adultTicket = 8.50;

         if (patronAge < 5 || patronAge >= 55) 
         {
            ticketPriceJTextField.setText("" + currency.format(freeTicket));    
         }

         if (patronAge >= 5 && patronAge <= 12) 
         {
            ticketPriceJTextField.setText("" + currency.format(childTicket));
         }

         if (patronAge >= 13 && patronAge <= 54) 
         {
            ticketPriceJTextField.setText("" + currency.format(adultTicket)); 
         }

         determineAdmissionStatus();
      }

   public void determineAdmissionStatus()
   {  
      freeAdmission = "Free";
      childAdmission = "Child";
      adultAdmission = "Adult";
      patronAge = Integer.parseInt(patronAgeJTextField.getText());

      if (ticketPrice == 0.00) 
      {
         admissionJTextField.setText("Free");    
      }

      if (ticketPrice == 4.25) 
      {
         admissionJTextField.setText("Child");
      }

      if (ticketPrice == 8.50) 
      {
         admissionJTextField.setText("Adult"); 
      }
   }


   public void clearJButtonActionPerformed(ActionEvent event)
   {
      patronAgeJTextField.setText("");
         patronAgeJTextField.requestFocusInWindow();
         ticketPriceJTextField.setText("");
         admissionJTextField.setText("");

   }
   public void closeJButtonActionPerformed(ActionEvent event)
   {
      System.exit(0);
   }

}

you never change the value of ticketPrice, so it will always return true when you test:
if (ticketPrice == 0.00 )

commented: Thank you for your help! +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.