-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
39 lines (24 loc) · 737 Bytes
/
Main.java
File metadata and controls
39 lines (24 loc) · 737 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
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner tastiera = new Scanner(System.in);
int metri, kilogrammi, centimetri;
System.out.println("inserisci il peso");
kilogrammi = tastiera.nextInt();
System.out.println("inserisci l'altezza(metri)");
metri = tastiera.nextInt();
System.out.println("Inserisci i centimetri ");
centimetri = tastiera.nextInt();
double altezza = metri + centimetri * 0.01;
double imc = kilogrammi / (altezza * altezza) ;
tastiera.close();
System.out.println(imc);
if (imc<18.5 ) {
System.out.println("Peso normale");
} if (imc <25 ) {
System.out.println("Sovrappeso");
} else {
System.out.println("Obeso");
}
}
}