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

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:

  1. Create a new project called 03.07 TDEE in your Mod03 Assignments folder.
  2. Create a class called TDEE in the newly-created project folder.
  3. This program should ask the user for their name, gender, and BMR.
  4. 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.
  5. The program needs to work properly for upper and lowercase input.
  6. Calculate the TDEE based on gender and activity factor.
  7. Design a user-friendly menu and neatly display the results after all user input is collected.
  8. 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.



Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The Problem code in c include Include the necessary header for inputoutput using namespace std int main string name Declare a string variable to store the users name float bmr tdee Declare floatingpoi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!