Write a program to calculate total daily energy expenditure. About TDEE: The total daily energy expenditure (TDEE)
Question:
Write a program to calculate total daily energy expenditure.
About TDEE:
The total daily energy expenditure (TDEE) is the amount of calories your body burns in 24 hours to support your basal metabolic rate and any additional activities you undertake. TDEE is calculated according to the following formula: TDEE = BMR * AF, where BMR is the basal metabolic rate and AF is the activity factor.
For a female with a BMR of 1312 and a moderate activity level, her TDEE would be 1312 * 1.6 = 2099.2 calories/day. A person's activity factor is determined by gender and a person's activity level, as described in the table below:
Activity Level | Activities | Activity Factor | |
---|---|---|---|
Male | Female | ||
Resting | Sleeping, reclining | 1.0 | 1.0 |
Sedentary | Minimal movement, mainly sitting/lying down (e.g., watching TV, reading, etc.) | 1.3 | 1.3 |
Light | Office work, sitting (e.g., walking, laundry, walking on level ground at 2.5 - 3.0 mph). | 1.6 | 1.5 |
Moderate | Light manual labor (e.g., dancing, cycling, gardening, etc.) | 1.7 | 1.6 |
Very Active | Hard manual labor (e.g., team sports, climbing, agricultural labor, etc.) | 2.1 | 1.9 |
Extremely Active | Heavy manual labor (e.g., full-time athletes, construction workers, etc.) | 2.4 | 2.2 |
Program Details:
- Create a new project called 03.07 TDEE in your Mod03 Assignments folder.
- Create a class called TDEE in the newly-created project folder.
- This program should ask the user for their name, gender, and BMR.
- Present the user with a menu of activity levels. The menu options should not be numeric. The user needs to be notified if a non-menu item is entered.
- The program needs to work properly for upper and lowercase input.
- Calculate the TDEE based on gender and activity factor.
- Design a user-friendly menu and neatly display the results after all user input is collected.
- Logical operators need to be correctly applied. Use a combination of String methods (excluding charAt()) and logical operators to test values for equality to determine Activity Factor.
You will save a significant amount of time if you take five minutes and design your menu and at least make a pseudocode outline of the structure of your program.
Expected Output: The design of the screen display for user input, the menu, and the program output is completely up to you; just be sure it is user-friendly.
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch