Question

In: Computer Science

Figure 5-35 shows that Mifflin-St Jeor formulas for calculating a person's basal metabolic rate (BMR), which...

Figure 5-35 shows that Mifflin-St Jeor formulas for calculating a person's basal metabolic rate (BMR), which is the minimum number of calories needed to keep his or her body functioning while resting for 24 hours. A personal trainer at a local health club wants a program that displays a client's BMR. a. Create an IPO chart for the problem, and then desk check the algorithm twice. For the first desk-check, display the BMR for a 25 year old male whose weight and height are 175 pounds and 6 feet, respectively. For the second desk check, display the BMR for a 31 year old female whose weight and height are 130 pounds and 5.5 feet, respectively. b. List the input, processing, and output items, as well as the algorithm, in a chart similar to the one shown earlier in figure 5-27. Then code the algorithm into a program. c. Desk check the program using the same data used to desk-check the algorithm. d. Display the BMR in fixed point notation with no decimal places. Test the program using the same data used to desk-check the program.

heres the chart

BMR formulas

Males = (10 x weight in kg)+ (6.25 x height in cm) - (5 x age in years) + 5

Females = (10 x weight in kg) + (6.25 x height in cm) - (5 x age in years) - 161

note: one kilogram equals 2.2 pounds one inch equals 2.54 centimeters

The programming language is c++

Solutions

Expert Solution

#include<iostream.h>
#include<iomanip.h>
#include<conio.h>
void main()
{
char gender;
int age,bmr;
float weight,height;
float weight_kg,height_cm;
clrscr();
cout<<"enter the person's gender(m for male ,f for female"<<endl;
cin>>gender;
cout<<"enter the person's weight"<<endl;
cin>>weight;
cout<<"enter the person's height"<<endl;
cin>>height;
cout<<"enter the age of the person"<<endl;
cin>>age;

height_cm=height*30.48;
weight_kg=weight/2.2;

switch(gender)
{
case 'm':
      bmr=(10*weight_kg)+(6.25*height_cm)-(5*age)+5;
      cout<<"BMR of the given person is "<<endl;
      cout<<bmr;
      break;

case 'f':
      bmr=(10*weight_kg)+(6.25*height_cm)-(5*age)-161;
      cout<<"BMR of the given person is "<<endl;
      cout<<bmr;
      break;
default:
   cout<<"enter the valid options..(m or f)"<<endl;
}


}

sample output
enter the person's gender(m for male, f for female)
m
enter the person's weight
175
enter the person's height
6
enter the age of the person
25
BMR of the given person is
1818


enter the person's gender(m for male, f for female)
f
enter the person's weight
130
enter the person's height
5.5
enter the age of the person
31
BMR of the given person is
1322


Related Solutions

Define basal metabolism and explain the factors that affect basal metabolic rate. What body mass index...
Define basal metabolism and explain the factors that affect basal metabolic rate. What body mass index (BMI) values are associated with being underweight, normal, overweight and obese? Name the factors that affect body fat composition and distribution. What are components of a sound approach to weight management? Choose a popular weight-loss diet; list and explain the pros and cons with citations/credible sources for each.
:  Create a new blank C# console application Your basal metabolic rate is the rate...
:  Create a new blank C# console application Your basal metabolic rate is the rate at which the body uses energy while at rest to keep vital functions going, such as breathing and keeping warm. This calculation is vital to weight management, as it allows you to determine calories needed to maintain, lose, or gain weight. To determine your BMR, use the appropriate formula: Female: 655+(4.35 x weight in pounds)+(4.7 x height in inches)-(4.7 x age in years) Males:...
The effects of testosterone include choose one? a. A decrease in basal metabolic rate. b. Skin...
The effects of testosterone include choose one? a. A decrease in basal metabolic rate. b. Skin thins and becomes drier. c. Bone density increases. d. Hair growth slows down. e. All of the above choices are correct. Which of the following events occurs during meiosis II? Select one: a. Production of 4 genetically distinct daughter cells b. Crossing over of homologous chromosomes c. Production of 2 haploid daughter cells d. Production of 4 identical, diploid daughter cells e. DNA replication...
25-1/Which hormone increases basal metabolic rate? Select one: _ a. Cortisol b. Insulin c. Thyroxine d....
25-1/Which hormone increases basal metabolic rate? Select one: _ a. Cortisol b. Insulin c. Thyroxine d. Progesterone 2/Which of the following is a function of tropomyosin in skeletal muscle? Select one: a. Binding to myosin during contraction - b. Releasing Ca+2 after initiation of contraction c. Acting as a relaxing protein d. Sliding on actin to produce shortening 3/Absorption of which of the following nutrients will be affected by total removal of stomach? Select one: _ a. Vitamin K _...
Calculated DRI: 3570 Your Basal Metabolic Rate is: 2136 calories. Your Average Daily Calorie Need Is:...
Calculated DRI: 3570 Your Basal Metabolic Rate is: 2136 calories. Your Average Daily Calorie Need Is: 2563 calories Explain why in order to lose weight you would need to ingest fewer Calories per day, or expend enough energy per day, so the net ingested daily Calories are less than the calculated DRI. How long would it theoretically take to lose the equivalent of one pound of fat if you ingested 100 calories/day less than the DRI? Would you agree that...
List the 5 basal ganglia. Indicate which are located in the cerebral hemispheres, which in the...
List the 5 basal ganglia. Indicate which are located in the cerebral hemispheres, which in the diencephalon, and which in the midbrain.
Metabolic rate, the rate at which the body consumes energy, is important in studies of weight...
Metabolic rate, the rate at which the body consumes energy, is important in studies of weight gain, dieting, and exercise. The provided table gives data on the lean body mass and resting metabolic rate for 12 women and 7 men who are subjects in a study of dieting. Lean body mass, given in kilograms, is a person’s weight leaving out all fat. Metabolic rate is measured in kilocalories (Cal) burned per 24 hours, the same calories used to describe the...
The figure to the right shows the results of a survey in which 2500 college graduates...
The figure to the right shows the results of a survey in which 2500 college graduates from the year 2016 were asked questions about employment. Construct 95​% confidence intervals for the population proportion of college students who gave each response. A table labeled "Employment, College students' responses to questions about employment" consists of five rows containing the following information from top to bottom, with row listed first and information listed second: Expect to stay at first employer for 3 or...
The figure to the right shows the results of a survey in which 1025 adults from...
The figure to the right shows the results of a survey in which 1025 adults from Country​ A, 1008 adults from Country​ B, 1023 adults from Country​ C, 1023 adults from Country​ D, and 1013 adults from Country E were asked whether national identity is strongly tied to birthplace. A table labeled "National Identity and Birthplace, People from different countries who believe national identity is strongly tied to birthplace" consists of five rows containing the following information from top to...
The figure shows a conical pendulum, in which the bob (the small object at the lower...
The figure shows a conical pendulum, in which the bob (the small object at the lower end of the cord) moves in a horizontal circle at constant speed. (The cord sweeps out a cone as the bob rotates.) The bob has a mass of 0.024 kg, the string has length L = 1.2 m and negligible mass, and the bob follows a circular path of circumference 1.2 m. What are (a) the tension in the string and (b) the period...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT