Write a java application that calculates and displays the


Write a Java application that calculates and displays the body mass index (BMI) for N people. N should be declared as a constant and should be equal to the largest digit of your student id number

Assume N=9,and take 9persons mass and height. The BMI is a measure of relative weight based on a 9 person's mass and height.

The application should ask the user to enter the name, height and mass of his or her body. Then program will calculate this person's BMI, which is defined as below,

BMI=mass/(height/100)2

Where mass is the body's weight to the nearest kilogram, and height is the body's height in the unit of centimetre. Both of mass and height are assumed to be integer numbers here.

The application should display the body mass index (to two digits of decimals) for each person and the summary of all people that we enter. This also includes the maximum value of BMI and a simple bar chart to show how many people's BMI less than 18.5 (a threshold value that indicates whether this person is in underweight). These requirements are can shown in figures 1 and 2 as below (see next page). Your program should display similar screen images when it runs. The application should be user-friendly by displaying appropriate welcome, exit and error message. The application can use the following classes and methods (but you can use different classes or methods if your program works OK; the solution program is not unique).




















(Ignore the display for other 3 inputs)

Figure 1






















Figure 2


public class Bmi


{


// declare data members


public Bmi( )


public void setName(String n)


public String getName()


public void setHeight(int h)


public int getHeight()


.......


public double calculateBMI()


public void displayInfo(...)
.

...........

}

public class BmiTest
{
public static main(String [ ] args)
{
//declare variables

//create Bmi object and call method //using scanner to read input data //set name, height, mass (using a loop) //call other methods

 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Write a java application that calculates and displays the
Reference No:- TGS01245946

Expected delivery within 24 Hours