0

```
/**
A programme which converts weight from pounds to kilograms and the height from inches to centimeters,
then it calculates body mass index.
@author
*/
import java.util.Scanner;
public class BodyMassIndex
{
public static void main(String[] args)
{
Scanner BMI = new Scanner(System.in);
System.out.println(BMI.nextLine());
double p, k, c, i, bmi;
Scanner scan = new Scanner (System.in);
System.out.print("How much do you weigh in pounds? ");
p = scan.nextDouble();
System.out.print("How much is your height in inches? ");
i = scan.nextDouble();
k = p / 2.2; //calculates kilogrammes from pounds
c = 2.54 * i; //calculates centimeters from inches
bmi = k / Math.pow(c/100,2); //calculates body mass index from the fomula given.
System.out.println("A person with weight "+p+" pounds and height "+i+" inches has Body Mass Index of:"+bmi+"") ;
}
}
```

this is the code i wrote...

but the question asks me to evaluate the BMI as an integer...

if I try to name BMI as int, it gives me an error about precision...

anyone know how to solve this problem???

*Edited 3 Years Ago by Dani*: Formatting fixed