Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1.  
  2. package javaapplication3;
  3. import java.util.Scanner;
  4.  
  5. public class Math {
  6.  
  7. public static void main(String[] args) {
  8. int d ;
  9. float T,S,O = 0 ;
  10.  
  11. Scanner in=new Scanner (System.in);
  12.  
  13. System.out.println ("Enter operation : \n 1 Account BMI:\n 2 exit :");
  14. d=in.nextInt();
  15.  
  16. switch (d){
  17. case 1:
  18. Scanner info=new Scanner (System.in);
  19. System.out.println ("Mass KG : ");
  20. int m=info.nextInt();
  21. System.out.println ("The length : ");
  22. int x=info.nextInt();
  23. T = x * x;
  24. S = m / T;
  25. O = S * 10000;
  26. break;
  27. case 2:
  28. System.exit(0);
  29. break;
  30. default :
  31. System.out.println("ERROR");
  32. System.exit(0);
  33.  
  34. }
  35. if(O < 20)
  36. {
  37. System.out.println("وزن اقل من طبيعي");
  38. }
  39. else if(O < 25)
  40. {
  41. System.out.println("وزن طبيعي");
  42. }
  43. else if(O < 30)
  44. {
  45. System.out.println("وزن زائد");
  46. }
  47. else if(O < 35)
  48. {
  49. System.out.println("سمنه خفيفه (من الدرجه الاولي)");
  50. }
  51. else if(O < 40)
  52. {
  53. System.out.println("سمنه متوسطه ( من الدرجه الثانيه)");
  54. }
  55. else
  56. {
  57. System.out.println("سمنه مفرطه ( من الدرجه الثالثه)");
  58. }
  59.  
  60.  
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement