Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

draw aflowchart from this coding double bmi = 0.00; double height; double weight; int waistSize; char count = 'y'; char counter = 'n'; Scanner sc

draw aflowchart from this coding

double bmi = 0.00; double height; double weight; int waistSize; char count = 'y'; char counter = 'n'; Scanner sc = new Scanner(System.in);

while (count != 'n') { System.out.println("BMI (18.5-24.9) -> Normal"); System.out.println("BMI (25-29.9) -> Over Weight"); System.out.println("BMI (30-34.9) -> Obese"); System.out.println("BMI (35-39.9) -> Severely Obese"); System.out.println("BMI (>=40) -> Morbidly Obese"); System.out.println("********************************************"); System.out.println("CAUTION!!"); System.out.println("Women waist size > 35 inches"); System.out.println("Men waist size > 40 inches "); System.out.println("----- HIGHER RISK FOR HEART DISEASE AND TYPE 2 DIABETES!!------"); System.out.println("*******************************************"); System.out.println(""); System.out.println("HEALTH CALCULATOR"); System.out.println(""); System.out.println("BMI calculator enter your information or (enter 'n' to stop): "); System.out.print("Enter your name: "); String name = sc.nextLine(); System.out.print("Enter your height in meter: "); height = sc.nextDouble(); System.out.print("Enter your weight in KG: "); weight = sc.nextDouble(); bmi = weight / (height * height); if (bmi >= 18.5 && bmi <= 24.9) { System.out.println("Your BMI is normal."); } else if (bmi >= 25 && bmi <= 29.9) { System.out.println("Your BMI is over weight."); } else if (bmi >= 30 && bmi <= 34.9) { System.out.println("Your BMI is obese."); } else if (bmi >= 35 && bmi <= 39.9) { System.out.println("Your BMI is severely obese."); } else if (bmi >= 40) { System.out.println("Your BMI is morbidly obese."); } System.out.println("********************************************"); System.out.println("CAUTION!!"); System.out.println("Enter number '1' if you are women. Enter number '2' if you are men. "); System.out.print("Enter your gender:"); int Gender = sc.nextInt(); System.out.print("Enter your waist Size"); waistSize = sc.nextInt();

if (waistSize >= 35) { System.out.println("----- HIGHER RISK FOR HEART DISEASE AND TYPE 2 DIABETES!!------"); } else if (waistSize <= 35) { System.out.println("you are health"); } else if (waistSize >= 40) { System.out.println("----- HIGHER RISK FOR HEART DISEASE AND TYPE 2 DIABETES!!------"); } else if (waistSize <= 40) { System.out.println("you are health");} System.out.printf(name + ", " + "%.2f" ,bmi); System.out.print(" so that means you are Normal and has a good life style..Congratss!!!!."); System.out.println(""); System.out.println(" BMI calculator enter your information or (enter 'n' to stop or 'y' to continue)"); count= sc.next().charAt(0);

System.out.println(""); sc.nextLine(); }

System.out.println("Thank you for using this calculator"); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions

Question

f. Did they change their names? For what reasons?

Answered: 1 week ago