Problem
A local health club wants to computerize the Body Mass Index (BMI) calculation for its members.
The BMI calculator uses height and weight to calculate the BMI. The BMI formula is:
Write java code for a BMI Class with both a default & non-default constructor, standard accessors, mutators (with valid argument checking), a method to return the BMI value, and a toString() method. The toString() method should also return the Weight Status from the below table.
BMI Weight Status Categories
BMI Weight Status
Below 18.5 Underweight
18.5 -24.9 Normal
25 - 29.9 Overweight
30 & Above Obese
Here is a sample code segment you might use to test your BMI class.
BMI data1 = new BMI();
BMI data2 = new BMI(250, 60);
data1.setHeight(76);
double value=data2.getBMI();
System.out.println(data1);
System.out.println(data2);