Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a basic C++ program that will calculate a subjects basal metabolic rate and estimate how many days it will take to lose a specific
Write a basic C++ program that will calculate a subjects basal metabolic rate and estimate how many days it will take to lose a specific number of pounds. The program will perform the following tasks:
- Declare variables and Named constants.
- Display Welcome to
s Weight Loss Calculator - Prompt the user to enter the subjects current weight.
- Prompt the user to enter the subjects height in feet plus inches.
- Prompt the user to enter the subjects age.
- Prompt the user to enter the subjects sex. (hint use type char to store M or F)
- Prompt the user to enter the subjects Activity Level (1.2-1.9) Sedentary-Extremely Active
- Prompt for the daily calorie reduction the subject is willing to sustain at current activity level: (hint use a variable named calReduc)
- Prompt for the subjects target weight
- Prompt the user to enter the subjects first name.
- Calculate the subjects height in inches (height= feet *12+ inches)
- If the subject is Female calculate basal metabolic rate: bmr= 655.0955 + (4.35 * weight ) + (4.7 * height) - (4.6756 * age).
- Use Named Constants for the Factors 655.0955, 4.35, 4.7, and 4.6756.
- Else for males calculate bmr= 66.473 + (6.237621 * weight) + (12.70838 * height) - (6.755 * age).
- Use Named Constants for the Factors 66.473, 6.237621, 12.70838 , and 6.755
- Calculate the adjusted bmradj=bmr*actLevel.
- Calculate the required daily caloric intake: dailyCals=bmradj-calReduc;
- Calculate weight to lose: wtToLose=weight-targetWt.
- Calculate days to target weight; daysToTarget = 3500*wtToLose/calReduc
- Clear the console screen: (hint use system(cls);)
- Display to the monitor the report heading
- Display the subjects bmr, adjusted bmr, caloric reduction, required caloric intake, weight to lose, days to reach target as shown in the report layout below.
- Thank the user for using the calculator.
- Calculate and display the number of days needed to reach a (Body Mass Index) BMI of 23.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started