Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class FitnessPlanner_1
- {
- public static void main(String[] args)
- {
- System.out.println(" This Fitness Planner program will calculate how long ");
- System.out.println(" you need to exercise to burn off what you just ate. ");
- Scanner input = new Scanner(System.in);
- System.out.println(" What is your weight in pounds? ");
- double weight = input.nextInt();
- System.out.println(" How many chicken nuggets did you eat? ");
- int nuggies = input.nextInt();
- System.out.println(" What is your average WALKING speed in mph? ");
- double walkingSpeed = input.nextInt();
- System.out.println(" What is your average RUNNING speed in mph? ");
- double runningSpeed = input.nextInt();
- // Variables List
- // 180 pounds burns 100cal/mile | 120 pounds burns 65cal/mile
- // VO2 = Oxygen consumption
- // VO2 for walking = 2.68224 x speed + 3.5
- // VO2 for running = 5.36448 x speed + 3.5
- // CBR = (0.00268) x VO2 x weight
- /*double WALKING = 2.68224;
- double RUNNING = 5.36448;
- */
- // Source
- //Calorieking.com
- //Processing
- // This is the logic for counting nuggies and total nuggie calories
- int NUGGIESCALSPER = 47;
- int NuggiesCountEnd = NUGGIESCALSPER * nuggies;
- // This is the logic for calculating calories burned while running
- double VO2Running = (2.68224 * walkingSpeed) + 3.5;
- System.out.println(" VO2Running outputs to = " + VO2Running); /* < Debugging */
- double calBurnRateR = .00268 * VO2Running * weight;
- System.out.println(" calBurnRateR outputs to = " + calBurnRateR); /* < Debugging */
- double caloriesRunning = Math.round(.00268 * calBurnRateR * weight);
- System.out.println(" caloriesRunning outputs to = " + caloriesRunning); /* < Debugging */
- double FinalCR = (caloriesRunning / NuggiesCountEnd);
- System.out.println(" FinalCR outputs to = " + FinalCR); /* < Debugging */
- // This is the logic for calculating calories burned while walking
- double VO2Walking = (5.36448 * walkingSpeed) + 3.5;
- System.out.println(" VO2Walking outputs to = " + VO2Running); /* < Debugging */
- double calBurnRateW = .00268 * VO2Walking * weight;
- System.out.println(" calBurnRateW outputs to = " + calBurnRateW); /* < Debugging */
- double caloriesWalking = Math.round(.00268 * calBurnRateW * weight);
- System.out.println(" caloriesWalking outputs to = " + caloriesWalking); /* < Debugging */
- double FinalCW = (caloriesWalking / NuggiesCountEnd);
- System.out.println(" FinalCW outputs to = " + FinalCW); /* < Debugging */
- System.out.println("The actual answer is below this string.");
- System.out.println(" You need to walk for " + caloriesWalking + " minutes to burn off the " + nuggies + " nuggets you ate. ");
- System.out.println(" You need to run for " + caloriesRunning + " minutes to burn off the " + nuggies + " nuggets you ate. ");
- // Stupid Below
- if (weight > 500)
- System.out.println("Jesus christ, stop eating chicken nuggets");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement