Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @Sean Wilson
- * @version 11/15/10
- */
- import java.util.Scanner;
- public class TDEE
- {
- public static void main(String[] args)
- {
- Scanner intInput = new Scanner(System.in);
- Scanner stringInput = new Scanner(System.in);
- System.out.print("Please enter your name: ");
- String name = stringInput.nextLine();
- System.out.print("Please enter your BMI: ");
- int BMI = intInput.nextInt();
- System.out.print("Please enter your Gender (M/F): ");
- String gender = stringInput.nextLine();
- System.out.println("");
- System.out.println("Select Your Activity Level");
- System.out.println("[A] Resting (Sleeping, Reclining)");
- System.out.println("[B] Sedentary (Minimal Movement)");
- System.out.println("[C] Light (Sitting, Standing)");
- System.out.println("[D] Moderate (Light Manual Labor, Dancing, Riding Bike)");
- System.out.println("[E] Very Active (Team Sports, Hard Manual Labor)");
- System.out.println("[F] Extremely Active (Full-Time Athelete, Heavy Manual Labor)");
- String menuChoice = stringInput.nextLine();
- double activityFactor;
- if(gender.equalsIgnoreCase("M"))
- {
- if(menuChoice.equalsIgnoreCase("A"))
- {
- activityFactor = 1.0;
- }
- else if(menuChoice.equalsIgnoreCase("B"))
- {
- activityFactor = 1.3;
- }
- else
- {
- activityFactor = 0;
- }
- }
- else if(gender.equalsIgnoreCase("F"))
- {
- if(menuChoice.equalsIgnoreCase("A"))
- {
- activityFactor = 1.0;
- }
- else if(menuChoice.equalsIgnoreCase("B"))
- {
- activityFactor = 1.3;
- }
- else
- {
- activityFactor = 0;
- }
- }
- else
- {
- activityFactor = 0;
- }
- System.out.println("\n\n" + activityFactor);
- //System.out.print("Enter the letter corresponding to your activity level: " + "\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement