Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program. Body Mass Index using the following functions: Develop a BMI (B

ID: 646835 • Letter: W

Question

Write a program. Body Mass Index using the following functions:

Develop a BMI (Body Mass Index) program with the following functions: 1. All I/O statements must be in GUI style 2. Development a BMI class with a default constructor, a constructor for person?s name, weight, height 3. A main class to demo the BMI class 4. Display programmer?s name (your name), the function of the program with BMI formula 5. Accept person?s name, weight, height 6. Verify I/P data, notify user of invalid data entered and allow to reenter. 7. Calculate the BMI value 8. Display these information: name, weight, height and BMI value with 2 decimal points (example: 29.95) 9. Give comment about her/his BMI such as: Underweight, normal weight, overweight, and obese 10. Save all data including comment of the BMI value in an array 11. Loop back for more BMI and give chance to end the loop 12. At end display the following information: - Total number of BMI calculated - Average BMI value - Lowest and highest BMI values 13. Allow user to look up BMI values in a loop with end of operation function. Draw and label these quantities in the figure below.

Explanation / Answer

Program

------------

  

/** NYIT CSCI prog2/java2 MID term exame   

The entire source file is stored as DEMO Calc BMI.java. Carefuly study this

source file which has been compiled without syntax error. You will be asked

in the MID term exam paper for answering questions concernng this classes.

*/

import javax.swing.JOptionPane;   

  

class Calc_BMI {

private String name;   

  

private int w;

private int h;

private double BMI;

public Calc_BMI () { name = "No name yet"; }

public Calc_BMI ( String newName ) { name = newName; }

public Calc_BMI ( int newW, int newH) { w = newW; h = newH; }   

public Calc_BMI ( String newName, int newW, int newH)

{ name = newName; w = newW; h = newH; BMI = BMI(); }

public void setW( int newW ) { w = newW; }

public void setH( int newH ) { h = newH; }   

public void getW( int myW ) { myW = w; }   

public void getH( int myH ) { myH = h; }

public void getBMI( double myBMI) { myBMI = BMI; } // LINE 24 remove this

public double BMI( ) { BMI = (w * 703) / ( h*h ); return BMI;}

public void writeOut()

{ System.out.print ("0/P format-console, Name: "

+name+ ", Weight= "+w + ", Height= "+h+ ", BMI= " + BMI() );

}

public void writeOut( String fmt)

{JOptionPane.showMessageDialog (null, "0/P format-" + fmt

  

+ " Name: " + name + " Weight= " + w

+ " Height= " + h + " BMI= " + (int)BMI() );

}

}

public class DEMO_Calc_BMI

{   

public static void main( String[] args)   

{

String ttl = "Calculates BMI value based on weight & height ";

System.out.print ( ttl );

Calc_BMI b = new Calc_BMI( "John Goodman",170,69 );

  

b.writeOut();

b.writeOut( "GUI" );

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote