Question
To explore the basic use of variables, write a java program with using only 3 variables that computes an individual's body mass index (BMI). Health
To explore the basic use of variables, write a java program with using only 3 variables that computes an individual's body mass index (BMI). Health professionals use this number to advise people about whether or not they are overweight. Given an individual's height and weight, we can compute that person's BMI. A simple BMI program, then, would naturally have three variables for these three pieces of information.
BMI = weight / (height * height) * 703
The person's weight is 195 and height is 70. Based on the person's information, calculate BMI and display the result on the console window.
Then, compute a new BMI assuming the person lost 15 pounds (going from 195 pounds to 180 pounds)
Limit to use only 3 variables: bmi, weight and height.
Sample output of the program:
Previous BMI: 27.97653061
Current BMI: 25.82448979
In the simplest java code possible, please. Nothing advanced.
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