Advertisement
Guest User

Help please :c

a guest
Feb 18th, 2020
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class FitnessPlanner_1
  4. {
  5. public static void main(String[] args)
  6. {
  7. System.out.println(" This Fitness Planner program will calculate how long ");
  8. System.out.println(" you need to exercise to burn off what you just ate. ");
  9.  
  10. Scanner input = new Scanner(System.in);
  11.  
  12. System.out.println(" What is your weight in pounds? ");
  13. double weight = input.nextInt();
  14.  
  15. System.out.println(" How many chicken nuggets did you eat? ");
  16. int nuggies = input.nextInt();
  17.  
  18. System.out.println(" What is your average WALKING speed in mph? ");
  19. double walkingSpeed = input.nextInt();
  20.  
  21. System.out.println(" What is your average RUNNING speed in mph? ");
  22. double runningSpeed = input.nextInt();
  23.  
  24.  
  25.  
  26. // Variables List
  27.  
  28. // 180 pounds burns 100cal/mile | 120 pounds burns 65cal/mile
  29. // VO2 = Oxygen consumption
  30. // VO2 for walking = 2.68224 x speed + 3.5
  31. // VO2 for running = 5.36448 x speed + 3.5
  32. // CBR = (0.00268) x VO2 x weight
  33.  
  34. /*double WALKING = 2.68224;
  35. double RUNNING = 5.36448;
  36. */
  37.  
  38. // Source
  39.  
  40. //Calorieking.com
  41.  
  42.  
  43.  
  44. //Processing
  45.  
  46. // This is the logic for counting nuggies and total nuggie calories
  47. int NUGGIESCALSPER = 47;
  48. int NuggiesCountEnd = NUGGIESCALSPER * nuggies;
  49.  
  50. // This is the logic for calculating calories burned while running
  51. double VO2Running = (2.68224 * walkingSpeed) + 3.5;
  52. System.out.println(" VO2Running outputs to = " + VO2Running); /* < Debugging */
  53. double calBurnRateR = .00268 * VO2Running * weight;
  54. System.out.println(" calBurnRateR outputs to = " + calBurnRateR); /* < Debugging */
  55. double caloriesRunning = Math.round(.00268 * calBurnRateR * weight);
  56. System.out.println(" caloriesRunning outputs to = " + caloriesRunning); /* < Debugging */
  57. double FinalCR = (caloriesRunning / NuggiesCountEnd);
  58. System.out.println(" FinalCR outputs to = " + FinalCR); /* < Debugging */
  59.  
  60.  
  61. // This is the logic for calculating calories burned while walking
  62. double VO2Walking = (5.36448 * walkingSpeed) + 3.5;
  63. System.out.println(" VO2Walking outputs to = " + VO2Running); /* < Debugging */
  64. double calBurnRateW = .00268 * VO2Walking * weight;
  65. System.out.println(" calBurnRateW outputs to = " + calBurnRateW); /* < Debugging */
  66. double caloriesWalking = Math.round(.00268 * calBurnRateW * weight);
  67. System.out.println(" caloriesWalking outputs to = " + caloriesWalking); /* < Debugging */
  68. double FinalCW = (caloriesWalking / NuggiesCountEnd);
  69. System.out.println(" FinalCW outputs to = " + FinalCW); /* < Debugging */
  70.  
  71.  
  72. System.out.println("The actual answer is below this string.");
  73. System.out.println(" You need to walk for " + caloriesWalking + " minutes to burn off the " + nuggies + " nuggets you ate. ");
  74. System.out.println(" You need to run for " + caloriesRunning + " minutes to burn off the " + nuggies + " nuggets you ate. ");
  75.  
  76.  
  77.  
  78. // Stupid Below
  79. if (weight > 500)
  80. System.out.println("Jesus christ, stop eating chicken nuggets");
  81. }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement