Calculates and displays the body mass index

Assignment Help Basic Computer Science
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

 

Reference no: EM13936625

Questions Cloud

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).

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Write a program with the output hello world hello

Write a program with the following output: (Notice the newline and space) Hello world! Hello

  Nonlinear regression equation converted in linear regression

Illustrtae how nonlinear regression equation Y = AX**B can be converted into linear regression equation solvable by method of Least Squares.

  Explain bec corporate is department

If you were the system analyst in BEC corporate IS department and you had recieved call from Carrie douglas about her Project idea,what would you suggest to Carrie?

  The xor gates are ideal for testing parity

The XOR gates are ideal for testing parity because even-parity words produce a _____ output and odd-parity words produce a _____ output

  What is encompassed in the term information technology

Define what is encompassed in the term information technology?

  Business continuity planning and disaster recovery planning

Imagine that you are trying to receive funding for select planning projects. Compare and contrast the attributes of business continuity and disaster recovery plans, and suggest the primary ways in which you would explain these differences to your emp..

  Create the logic for a program

Create the logic for a program that continuously prompts the user for a number of dollars until the user enters 0. Pass each entered amount to a conversion method that displays a breakdown of the passed amount into the fewest bills; in other words..

  Describe a group project for which videoconferencing

Describe a group project for which videoconferencing would be a necessity. What options are available for video conferencing.

  How many time is the loop body of the while statement

Assume that all variables are of type int. z = 0; g = 0; s = 0; i = 0; while (i = 0) g = g + 1; else z = z + 1; i = i + 1; } 1.How many time is the loop body of the while statement executed?

  Work with dictionary and create relational database

In this lab, you will prepare a Data Dictionary based on the list of elements. Also, your task will be determined the tables, their relationships, primary and foreign keys. Based on this analysis, you will create Database Schema, relational tables..

  What is the output of the following program

What is the output of the following program?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd