1. Engineering
  2. Computer Science
  3. to explore the basic use of variables write a java...

Question: to explore the basic use of variables write a java...

Question details

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.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution