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

  A direct-mapped cache with 8 two-word blocks

Based on the following sequence of word addresses generated by the processor:1, 134, 212, 1, 135, 213, 162, 161, 2, 44, 41, 221a) Given a direct-mapped cache with 8 two-word blocks that is initially empty

  How enterprise architecture and enterprise systems

1. How enterprise architecture and enterprise systems influence, support, and enable an organization's ability to contribute to strategic decision-making.2. How enterprise architecture and enterprise systems respond and adapt to the business environm..

  Assignment on mobile app work breakdown structure

Assignment On Mobile App (Work Breakdown Structure), This assignment contains two (2) deliverables: a summary document to be delivered in a word processor document format and a Work Breakdown Structure (WBS) to be delivered in a project file.

  Problem releated to relationship-inheritance

Grading: For each programming assignment, you are graded by explaining and demoing your code to a TA. You must demo your program BEFORE the next assignment is due, and if you fail to do so, you will automatically lose 50 points! Your job is to con..

  What is a lan how does the implementation of a lan work

You are employed as an engineer for a startup company. The company is now in the planning stage, and some important decisions must be made about what technology will be leveraged. The company is to be headquartered in Chicago, with small branch..

  Who swallowed a spider

There was an old woman who swallowed a fly. I don't know why she swallowed that fly, Perhaps she'll die. There was an old woman who swallowed a spider,

  Whose trademark is the operating system unix

Whose trademark is the operating system UNIX? A.Motorola B.Microsoft C.BELL Laboratories D.AshtonTate

  User and system passwords

Application: Password Scan User and system passwords, in theory, should be relatively easy to remember and be hard to guess (which includes avoiding common words susceptible to a "dictionary" attack). Many sites require that passwords conform to rule..

  Determine the bit representation for each of the following

Determine the bit representation for each of the following for 32-bit floating point notation

  Describe systems which make numeric predictions

So far we have been concerned with measuring performance of classifiers. I.e. systems which forecasts nominal variables. Describe about systems which make numeric predictions?

  Access control policy for lmj-star services

You have been asked to develop an access control policy for LMJ-Star Services (LSS) based on your understanding of the sensitivity of financial data and health care data.

  Computer science homework please look at the following and

please look at the following and quote me. will pay extra for same day delivery. due at midnight est time 12112014.

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