am from the u.k and a newbie to java and i need to create a Body Mass Index Calculator....ive been trying for awhile going through java books but can't seem to get it right....can any one please create a BMI calculator which is really simple and shows weight status table. i have to create this table using Jpad pro....only the javascript code is required so it works without errors when compiled on Jpad pro.
i managed to create this as simple as i can i have ONE ERROR...
if anyone can make it any more simple then please do....and also add the the weight status table if its possiblepublic class BMI { public static void main(String[] args) { int weight; //weight int height; //height int BMI; //BMI char Overweight=0; //Overweight char Normal_Weight=0; //Normal Weight char Underweight=0; //Underweight Scanner input = new Scanner(System.in); System.out.print("Enter the weight: "); weight = input.nextInt(); System.out.print("Enter the height: "); height = input.nextInt(); input.close(); BMI = weight / height; System.out.println("BMI (Body Mass Index): " + BMI); if (BMI >= 25 ) { BMI = Overweight; System.out.print("BMI = "); } }
thhanx in advance!