Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication3;
- import java.util.Scanner;
- public class Math {
- public static void main(String[] args) {
- int d ;
- float T,S,O = 0 ;
- Scanner in=new Scanner (System.in);
- System.out.println ("Enter operation : \n 1 Account BMI:\n 2 exit :");
- d=in.nextInt();
- switch (d){
- case 1:
- Scanner info=new Scanner (System.in);
- System.out.println ("Mass KG : ");
- int m=info.nextInt();
- System.out.println ("The length : ");
- int x=info.nextInt();
- T = x * x;
- S = m / T;
- O = S * 10000;
- break;
- case 2:
- System.exit(0);
- break;
- default :
- System.out.println("ERROR");
- System.exit(0);
- }
- if(O < 20)
- {
- System.out.println("وزن اقل من طبيعي");
- }
- else if(O < 25)
- {
- System.out.println("وزن طبيعي");
- }
- else if(O < 30)
- {
- System.out.println("وزن زائد");
- }
- else if(O < 35)
- {
- System.out.println("سمنه خفيفه (من الدرجه الاولي)");
- }
- else if(O < 40)
- {
- System.out.println("سمنه متوسطه ( من الدرجه الثانيه)");
- }
- else
- {
- System.out.println("سمنه مفرطه ( من الدرجه الثالثه)");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement