//---------- Program BMIApplet (Step 1) ------------------------//

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


/**
 * Introduction to OOP with Java 2nd Edition, McGraw-Hill
 *   
 *  Chapter 5
 *
 *  Program BMIApplet
 *
 * <p>
 * This applet computes the body mass index (BMI).
 * It accepts the user’s height and weight and displays
 * his/her BMI according to the formula
 *         
 *        BMI = weight / (height * height)
 *
 */
public class BMIApplet extends Applet implements ActionListener
{

//----------------------------------
//    Data Members
//----------------------------------

    /**
     * The label for heightInput TextField
     */
    private Label      heightLabel;
    
    /**
     * The label for weightInput TextField
     */
    private Label      weightLabel;
    
    /**
     * The label for displaying BMI
     */
    private Label      BMILabel; 

    /**
     * The TextField to accept the user's height
     */
    private TextField  heightInput;
    
    /**
     * The TextField to accept the user's weight
     */
    private TextField  weightInput; 

    /**
     * The Button the user clicks to compute the BMI
     */
    private Button     computeButton;


//----------------------------------
//    Constructors
//----------------------------------
                                
    /**
     * Default constructor for creating and placing GUI objects
     * on this applet.
     */
    public BMIApplet()
    {
        computeButton = new Button("  Compute BMI  ");

        add(computeButton);  
    }
    

//-----------------------------------------------------
//     Public Methods:
// 
//         void   actionPerformed   (  ActionEvent   )
//
//-----------------------------------------------------
    /**
     * Implements the abstract method defined in the interface 
     * ActionListener. 
     *
     * @param event the ActionEvent object
     *
     */
    public void actionPerformed(ActionEvent event)
    {
        
    }


}