Answered step by step
Verified Expert Solution
Link Copied!

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:

  1. Declare variables and Named constants.
  2. Display Welcome to s Weight Loss Calculator
  3. Prompt the user to enter the subjects current weight.
  4. Prompt the user to enter the subjects height in feet plus inches.
  5. Prompt the user to enter the subjects age.
  6. Prompt the user to enter the subjects sex. (hint use type char to store M or F)
  7. Prompt the user to enter the subjects Activity Level (1.2-1.9) Sedentary-Extremely Active
  8. Prompt for the daily calorie reduction the subject is willing to sustain at current activity level: (hint use a variable named calReduc)
  9. Prompt for the subjects target weight
  10. Prompt the user to enter the subjects first name.
  11. Calculate the subjects height in inches (height= feet *12+ inches)
  12. If the subject is Female calculate basal metabolic rate: bmr= 655.0955 + (4.35 * weight ) + (4.7 * height) - (4.6756 * age).
  13. Use Named Constants for the Factors 655.0955, 4.35, 4.7, and 4.6756.
  14. Else for males calculate bmr= 66.473 + (6.237621 * weight) + (12.70838 * height) - (6.755 * age).
  15. Use Named Constants for the Factors 66.473, 6.237621, 12.70838 , and 6.755
  16. Calculate the adjusted bmradj=bmr*actLevel.
  17. Calculate the required daily caloric intake: dailyCals=bmradj-calReduc;
  18. Calculate weight to lose: wtToLose=weight-targetWt.
  19. Calculate days to target weight; daysToTarget = 3500*wtToLose/calReduc
  20. Clear the console screen: (hint use system(cls);)
  21. Display to the monitor the report heading
  22. 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.
  23. Thank the user for using the calculator.
  24. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

Find the area of the triangle. b = 4, c = 10, A = 70

Answered: 1 week ago

Question

Develop knowledge of the Italian entrepreneurial business context.

Answered: 1 week ago