Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java Programming 20 marks] Create a Person class that includes the name of the person, the weight of the person (in pounds), and the height
Java Programming
20 marks] Create a Person class that includes the name of the person, the weight of the person (in pounds), and the height of the person (in inches). For the data listed in the table below, create four Person objects. Compute their individual body mass index (BMI) and store it as part of these objects. Further, determine their weight category (see below) and add that information as part of the object as well. Store each of these four Person objects, their corresponding BMI, and weight category in a different ArrayList and develop get and set methods to access elements in that ArrayList Name Weight (pounds) Height (inches) Andrew 125.5 Boyd 150.0 Cathy 135 Donna190 55.1 67 72.3 64 BMI is calculated using the following formula: BMI wtght (Ub) x 703 (height (in))2 BMI can indicate the following categories: Underweight when BMI is less than 18.5 Normal weight when BMI is between 18.5 and 25 Overweight when BMI is between 25 and 30 . Obese when BMI is 30 or greater Person E Attributes + private double bmi + private double height + private double weight + private String category + private String name E Operations + public double getBMI() + public double getHeight() + public double getWeight) + public Person(String name, double weight, double height) + public String getCategory(double bmi) +public String getCategory() + public String getName() + public void setBMI(double bmi) + public void setHeight(double height) + public void setName(String name) + public void setWeight(double 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