Question: First step is to create a class called BodyMassIndex (BodyMassIndex.java) which will not contain a main. The BodyMassIndex class will be very simple which will

First step is to create a class called BodyMassIndex (BodyMassIndex.java) which will not contain a main. The BodyMassIndex class will be very simple which will contain three private instance variables: o studentName as a String o height as a double o weight as a double The following public methods will have to be implemented: o A default constructor o A parameterised constructor o Three set methods (mutators) o Three get methods (accessors) o deriveBodyMassIndex value returning method* o deriveRatingvalue returning method** *You will create a public value returning method deriveBodyMassIndex(), the body mass index can be derived from the instance variables height and weight. Typically we do not store calculated values in a database so the BMI will be derived via your deriveBodyMassIndex() method. Do not store the body mass index as an instance variable. **You will also create a public value returning method deriveRating() to return the BMI rating Underweight, Normal, Overweight etc (see assignment one). The rating can be derived from the BMI and as with the BMI above typically we do not store calculated values in a database and the rating will be retrieved via your deriveRating() method. Use constants in the if statements for the grade boundaries. Hint: use deriveBodyMassIndex() method above in your deriveRating() method to calculate the BMI (we do not want to repeat any code in our program).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!