Hey guys,
I'm a newbie programmer and I'm trying to create a program which calculates BMI. Weight is in lbs and height is in inches. I've compiled this and its got quite a bit of errors, so I could really use some help.
The final result that I'm trying to get is for example if a user types in 165 for weight and 70 for height then it should print out
A person with weight 165 lbs and height 70 inches has bmi = 23.672448979591838
Any help is appreciated!
*int type declarations must remain in the program*
This is my program so far:
// HealthIndex.java
// My Name
public class HealthIndex
{
// interactively reads in an integer height and weight
// prints out the douvel BMI for the given height and weight
public static void main( String[] args )
{
final int BMI_CONSTANT = 703;
int weight; // in lbs.
int height; // in inches
Scanner scan = new Scanner(System.in);
System.out.println("Enter in your weight: ");
int weight = scan.nextDouble();
System.out.println("Enter in your height: " );
int height = scan.nextDouble();
// calculate Body Mass Index(bmi) and print results
weight = pound;
height = inches;
int BMI = weight/(height*height);
System.out.println(A person with weight "+weight+" lbs and height "+height+" inches has bmi = "+bmi+"); )
}
}
Cheers,
~Jibby