CSC1109_Tutorials/Week4_Lab/BMI_Main.java

22 lines
579 B
Java

package Week4_Lab;
import java.util.Scanner;
public class BMI_Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.print("Enter your weight in pounds: ");
double weightInPounds = s.nextFloat();
System.out.print("Enter your height in inches: ");
double heightInInches = s.nextFloat();
BMI bmi = new BMI(heightInInches, weightInPounds);
System.out.println("BMI is " + bmi.calBMI(bmi.getHeightInInches(), bmi.getWeightInPounds()));
bmi.BMIInterpretation();
}
}