Step 1: Program Skeleton
/*******************************************************************************
Program: Body Mass Index (BMI) Calculator (Step 1)
Author: Rebecca Hasti, hasti@cs.wisc.edu
copyright 2000, all rights reserved
Course: CS 302 Summer 2000
Compiler: CodeWarrior (JDK 1.2)
Platform: Windows NT 4.0
*******************************************************************************/
import javabook2.*;
/**
* This program calculates the body mass index (BMI) for a person
* given his/her height and weight. A BMI of 20 to 25 is considered
* "normal".
*
* Body mass index is calculated as follows:
* BMI = (weight in kilograms)/(height in meters)^2
*
* Input: person's name (String)
* height in inches (int)
* weight in pounds (int)
*
* Compute: body mass index (double)
*
* BUGS: none known
**/
class BMICalculator {
public static void main(String args[]) {
// declare and create the input and output objects
MainWindow mainWindow = new MainWindow("Body Mass Index Calculator");
InputBox inputBox = new InputBox(mainWindow);
OutputBox outputBox = new OutputBox(mainWindow);
mainWindow.show();
outputBox.show();
} // end method main
} // end class BMICalculator
Go to Step 2: Input