Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. /**
  2. * @Sean Wilson
  3. * @version 11/15/10
  4. */
  5. import java.util.Scanner;
  6. public class TDEE
  7. {
  8. public static void main(String[] args)
  9. {
  10. Scanner intInput = new Scanner(System.in);
  11. Scanner stringInput = new Scanner(System.in);
  12. System.out.print("Please enter your name: ");
  13. String name = stringInput.nextLine();
  14. System.out.print("Please enter your BMI: ");
  15. int BMI = intInput.nextInt();
  16. System.out.print("Please enter your Gender (M/F): ");
  17. String gender = stringInput.nextLine();
  18. System.out.println("");
  19. System.out.println("Select Your Activity Level");
  20. System.out.println("[A] Resting (Sleeping, Reclining)");
  21. System.out.println("[B] Sedentary (Minimal Movement)");
  22. System.out.println("[C] Light (Sitting, Standing)");
  23. System.out.println("[D] Moderate (Light Manual Labor, Dancing, Riding Bike)");
  24. System.out.println("[E] Very Active (Team Sports, Hard Manual Labor)");
  25. System.out.println("[F] Extremely Active (Full-Time Athelete, Heavy Manual Labor)");
  26. String menuChoice = stringInput.nextLine();
  27. double activityFactor;
  28. if(gender.equalsIgnoreCase("M"))
  29. {
  30. if(menuChoice.equalsIgnoreCase("A"))
  31. {
  32. activityFactor = 1.0;
  33. }
  34. else if(menuChoice.equalsIgnoreCase("B"))
  35. {
  36. activityFactor = 1.3;
  37. }
  38. else
  39. {
  40. activityFactor = 0;
  41. }
  42. }
  43. else if(gender.equalsIgnoreCase("F"))
  44. {
  45. if(menuChoice.equalsIgnoreCase("A"))
  46. {
  47. activityFactor = 1.0;
  48. }
  49. else if(menuChoice.equalsIgnoreCase("B"))
  50. {
  51. activityFactor = 1.3;
  52. }
  53. else
  54. {
  55. activityFactor = 0;
  56. }
  57. }
  58. else
  59. {
  60. activityFactor = 0;
  61. }
  62.  
  63. System.out.println("\n\n" + activityFactor);
  64. //System.out.print("Enter the letter corresponding to your activity level: " + "\n");
  65. }
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement