Answered step by step
Verified Expert Solution
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
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 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started