Created
February 27, 2019 04:07
-
-
Save TuAnhTo/576421d01f8907ba13a29a2c4e3e1d21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package session1.ChiSoCanNang; | |
import java.util.Scanner; | |
public class BMI { | |
public static void main(String[] args) { | |
Scanner nhap = new Scanner(System.in); | |
double weight, heght,bmi; | |
System.out.println(" nhap vao so can nang kg"); | |
weight = nhap.nextDouble(); | |
System.out.println(" nhap vao chieu cao"); | |
heght = nhap.nextDouble(); | |
bmi = weight / Math.pow(heght,2); | |
if ( bmi < 18){ | |
System.out.println(" chi so bmi" + bmi + "can nang thieu"); | |
} else if ( bmi < 25){ | |
System.out.println("chi so bmi" + bmi + " can nang binh thuong"); | |
} else if ( bmi < 30){ | |
System.out.println("chi so bmi" + bmi + " thua can"); | |
} else { | |
System.out.println(" ban da bi map roi"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment