- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbmi.java
More file actions
Latest commit
19 lines (15 loc) · 519 Bytes
/
Copy pathbmi.java
File metadata and controls
19 lines (15 loc) · 519 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
importjava.util.Scanner;
publicclassbmi {
publicstaticvoidmain(String[] args) {
doubleweight,height;
Scannerinp = newScanner(System.in);
System.out.println("enter height(m):");
height = inp.nextDouble();
System.out.println("enter weight(kg):");
weight = inp.nextDouble();
doubleindex = weight/(height*height);
System.out.println("your body mass index is :");
System.out.format("%.2f",index);
inp.close();
}
}