Question
BMI class: create FindBMI() method to return BMI value according to height and weight. BMI.java public class BMI { private double height, weight; BMI(double height,
BMI class:
create FindBMI() method to return BMI value according to height and weight.
BMI.java
public class BMI { private double height, weight;
BMI(double height, double weight) { this.height = height; this.weight = weight; }
BMI() { height = 0.0; weight = 0.0; }
void setHeight(double updateHeight) { height = updateHeight; }
void setWeight(double updateWeight) { weight = updateWeight; } double getHeight() { return height; }
double getWeight() { return weight; }
// 1. create FindBMI() method to return BMI value according to height and weight: public String toString() { return "Height " + height + "\t Weight: " + weight; }
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started