Could someone please tell me if this looks right...

import jpb.*;

public class Program1{

public static void main(String[] args) {

//Declare constant values

final double POUNDS_PER_KILOGRAM = 2.2;

final double INCHES_PER_METER = 39.37;

final double INCHES_PER_FOOT = 12;

//Declare variables used to store user input

String userInput;

double feet;

double inches;

double weightInPounds;

//Get the user's heigh (feet only)

System.out.print("Enter height in feet: ");

userInput = SimpleIO.readLine();

feet = Double.parseDouble(userInput);

//Get the user's heigh (inches only)

System.out.print("Enter height in inches: ");

userInput = SimpleIO.readLine();

inches = Double.parseDouble(userInput);

//Get the user's weight (in pounds)

System.out.print("Enter weight in pounds: ");

userInput = SimpleIO.readLine();

weightInPounds = Double.parseDouble(userInput);

//Declare variables used for calculations

double totalHeightInInches;

double totalHeightInMeters;

double weightInKilograms;

double bodyMassIndex;

//Calculate the user's total height in meters

totalHeightInInches = feet * INCHES_PER_FOOT + inches;

totalHeightInMeters = totalHeightInInches / INCHES_PER_METER;

//Convert the user's weight to kilograms

weightInKilograms = pounds / POUNDS_PER_KILOGRAM;

//Calculate the Body Mass Index

bodyMassIndex = weightInKilograms * weightInKilograms / totalHeightInMeters

//Display their height and weight

System.out.println();

System.out.print("You are " + feet + " feet " + inches + " inches or ");

System.out.println(totalHeightInMeters + " meters tall");

System.out.println("You weigh " + weightInPounds + " pounds");

//Diplay their calculated Body Mass Index

System.out.println();

System.out.print("Your Body Mass Index is " + bodyMassIndex);

System.out.println();

}

}

Does this look right?

I'm not sure about this part...

//Diplay their calculated Body Mass Index

System.out.println();

System.out.print("Your Body Mass Index is " + bodyMassIndex);

System.out.println();

Because on a previous program, that part had 4 lines and mine only has 2.

[2320 byte] By [Drey30] at [2007-9-30 19:08:16]
# 1
Anybody?
Drey30 at 2007-7-6 23:19:00 > top of Java-index,Java Essentials,Java Programming...
# 2
Does it do what it is supposed to do? If so, it seems to be fine, if not, tell what you expected and what you got.
PhHein at 2007-7-6 23:19:00 > top of Java-index,Java Essentials,Java Programming...
# 3

> I'm not sure about this part...

>

> //Diplay their calculated Body Mass Index

> System.out.println();

> System.out.print("Your Body Mass Index is " +

> bodyMassIndex);

>

> System.out.println();

>

> Because on a previous program, that part had 4 lines

> and mine only has 2.

Why would that matter?

ehodges at 2007-7-6 23:19:00 > top of Java-index,Java Essentials,Java Programming...
# 4
No, it is not correct. BMI is age and gender specific.
filestream at 2007-7-6 23:19:00 > top of Java-index,Java Essentials,Java Programming...