Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i have this code which calculates a persons bmi through entering your height in meters and weight in kg if i enter weight 65.7kg and

i have this code which calculates a persons bmi through entering your height in meters and weight in kg
if i enter weight 65.7kg and height 1.65m i get 24.13322314 etc
just need help making it to 2 decimal places so it reads 24.1
thanks
image text in transcribed
iaport java, util, Scanner; pubtic class CalculateBMI \& public static void main(String[] args) f Scanner in = new Scanner(Systen. In); /losk the usen to onter height and welght Systen,out, print ("Enter your weight in Kg: :"); double weight =1n, nextdouble(); System.out.print("Enter your height in meters: "); double height = in, nextbouble(); //coapute the bif double h, = weight / (height * height); I/check bmi range and print the bai and in which range it folls. If (bmi=25.0sisbmi29.9)f System,out, println("Your 8MI 1s, " + bmi + " which means you are in the overweloht range."); J else 1 System.out, println("Your BMI is, " boi + " which koans you are in the obese rango,"); 1

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

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions

Question

=+e. Storytelling present product in a story.

Answered: 1 week ago