forked from nishitpanchal395/projecthactoberfest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBmiCal.java
31 lines (24 loc) · 914 Bytes
/
BmiCal.java
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
import java.util.Date;
import java.util.Scanner;
public class BmiCal {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
System.out.println("Enter next person's information:");
System.out.print("height (in inches)? ");
double height = console.nextDouble();
System.out.print("weight (in pounds)? ");
double weight = console.nextDouble();
System.out.println();
double bmi = weight / Math.pow(height, 2) * 703;
System.out.println("BMI:"+bmi);
if (bmi < 18.5) {
System.out.print("You are in underweight");
} else if (bmi < 25) {
System.out.print("You are in normal");
} else if (bmi < 30) {
System.out.print("You are in overweight");
} else {
System.out.print("You are in obese");
}
}
}