Reference no: EM13936625
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
Find all the prime numbers between 90,000 and 100,000
: Print out the nonzero values in the array and that will be the prime numbers. Print out the numbers 7 per line and make sure they line up on the last digit. (setw(8)???)
|
Evaluate the pirellis performance
: Calculate Pirelli's bonus for 2008. Evaluate Pirelli's performance. Did he do as good a job as the numbers in requirement 1 suggest? Explain.
|
With the latest threats and security issues
: Security professionals need to ensure that they keep up to date with the latest threats and security issues. This allows them to update their risk profiles, such as identifying if their systems are vulnerable.
|
What leading primary producers and top consumers ecosystem
: What are the consequences if all individuals belonging to one of these key species are removed? (Choose one specific example and describe the impact on other organisms in the ecosystem as well as on the abiotic environment.)
|
Calculates and displays the body mass index
: 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
|
Write the code to test the queue class
: Write the code to test the queue class by determining if the following strings are char-by-char palindromes:
|
Data and command signals from mission control
: Need to analysis everything and have to write report by referring the information available on internet. The final project for our EE 413 course this quarter will be as follows.... You are the chief systems engineer for a new project that involve..
|
Discuss the relevant international laws and policies
: Identify a data breach case which was international and discuss the relevant international laws and policies used to address and prosecute those responsible for the breach
|
Program that prints out any size triangle based on 2 inputs
: My goal is to write a program that prints out any size triangle based on either one or two inputs (would prefer 2; e.g. range[a, e]). Each line of the triangle will be centered and looks like the attached output (equilateral triangle).
|