-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbmi.java
More file actions
46 lines (34 loc) · 728 Bytes
/
Copy pathbmi.java
File metadata and controls
46 lines (34 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import java.util.Scanner;
class BMI{
public static void main(String args[])
{
double height;
double weight;
double answer;
Scanner s1=new Scanner(System.in);
System.out.println("enter your weight");
weight=s1.nextDouble();
System.out.println("weight is " + weight);
System.out.println("enter your height");
height=s1.nextDouble();
System.out.println("weight is " + height);
answer=(height*height)/(weight);
System.out.println("your bmi is " + answer);
if(answer < 18.5)
{
System.out.println("underweight");
}
if((answer >= 18.5)&&(answer < 25.0))
{
System.out.println("normal");
}
if((answer > 25.0)&&(answer < 30.0))
{
System.out.println("overweight");
}
if(answer >= 30.0)
{
System.out.println("obese");
}
}
}