Question

In: Computer Science

One way to determine how healthy a person is by measuring the body fat of the...

One way to determine how healthy a person is by measuring the body fat of the person.
The formulas to determine the body fat for female and male are as follows:

Body fat formula for women:

  • A1 = Body Weight * 0.732 + 8.987
  • A2 = Wrist Measurement At Fullest Point / 3.140
  • A3 = Waist Measurement At Navel * 0.157
  • A4 = Hip Measurement At Fullest Point * 0.249
  • A5 = Forearm Measurement At Fullest Point * 0.434
  • B = A1 + A2 - A3 - A4 + A5
  • Body Fat = Body Weight - B
  • Body Fat Percentage = Body Fat * 100 / Body Weight

Body fat formula for men:

  • A1 = Body Weight * 1.082 + 94.42
  • A2 = Waist Measurement At Fullest Point * 4.15
  • B = A1 - A2
  • Body Fat = body Weight - B;
  • Body Fat Percentage = Body Fat * 100 / body Weight

In C program

Write a program that asks for the gender and the all the input appropriate to the gender, then calculate and display the Body Fat and Body Fat Percentage.

Example (Numbers and symbols with underscore indicate an input):

This program determines the body fat of a person.

Enter your gender (f|F|m|M): F

Enter body weight (in pounds): 120

Enter wrist measurement at fullest point (in inches): 5

Enter waist measurement at navel (in inches): 32

Enter hip measurement at fullest point (in inches): 36

Enter forearm measurement at fullest point (in inches): 23

Body fat: 25.586643
Body fat percentage: 21.322203

--------------------------------------------

This program determines the body fat of a person.

Enter your gender (f|F|m|M): m

Enter body weight (in pounds): 120

Enter waist measurement at fullest point (in inches): 5

Body fat: -83.510000
Body fat percentage: -69.591667

Solutions

Expert Solution

Following is the C program :

#include<stdio.h>

void main()

{

char ch;

int weight, waist, wrist, hip, farm ;

float A1, A2, A3, A4, A5, B, bfat, bfatp;

printf("This program determines the body fat of a person.");

printf("Enter your gender (f|F|m|M):");

scanf("%c",&ch);

if(ch=="m" || ch=="M")

{

printf("Enter body weight (in pounds): ");

scanf("%d",&weight);

A1= weight * 1.082 + 94.42;

printf("Enter waist measurement at fullest point (in inches): ");

scanf("%d",&waist);

A2= * 4.15;

B=A1-A2;

bfat=weight-B;

bfatp= bfat*100/weight;

printf("Body fat: %f",bfat);

printf("Body fat percentage: %f",bfatp);

}

else if(ch=="F" || ch=="f")

{

printf("Enter body weight (in pounds): ");

scanf("%d",&weight);

A1 = Body Weight * 0.732 + 8.987;

printf("Enter wrist measurement at fullest point (in inches):");

scanf("%d",&wrist);

A2 = wrist / 3.140;

printf("Enter waist measurement at navel (in inches): ");

scanf("%d",&waist);\

A3 = waist * 0.157;

printf("Enter hip measurement at fullest point (in inches):");

scanf("%d",&hip);

A4 = hip* 0.249;

printf("Enter forearm measurement at fullest point (in inches):");

scanf(%d",&farm);

A5 = farm* 0.434;

B = A1 + A2 - A3 - A4 + A5;

bfat = weight - B;

bfatp = bfat * 100 / weight;

printf("Body fat: %f",bfat);

printf("Body fat percentage: %f",bfatp);

}

}


Related Solutions

It's possible to estimate the percentage of fat in the body by measuring the resistance of...
It's possible to estimate the percentage of fat in the body by measuring the resistance of the upper leg rather than the upper arm; the calculation is similar. A person's leg meas-ures 40cm between the knee and the hip, with an average leg diameter (ignoring bone and other poorly conducting tissue) of 12cm . A potential difference of 0.79V causes a current of 1.6mA . What are the fractions of muscle and fat in the leg? Please show full work,...
Body fat and lean body mass can be estimated in living animals by measuring the total...
Body fat and lean body mass can be estimated in living animals by measuring the total body electrical conductivity (TOBEC). This technique is useful when attempting to determine if "diet drugs" are working on laboratory rats over time – the researchers need not sacrifice the animals to measure the amount of adipose body fat after periods of drug usage. However, the procedure requires that the animal be totally inside the measurement chamber, which is fairly small. Some, but not all...
true or false: 1. in order to lose one pound of body fat, a person need...
true or false: 1. in order to lose one pound of body fat, a person need to exercise for 3500 second 2. the EER includes the amount of physical activity you engage in as compared to the BMR which is simply a calculation of calories needed to sustain life. 3. BMI is an indication of overall cholesterol and glucose levels
nutrition-- 1)make a chart that compares the methods for measuring body fat.
nutrition-- 1)make a chart that compares the methods for measuring body fat.
One way of measuring how socialist or capitalist a country leans is to: A) measure how...
One way of measuring how socialist or capitalist a country leans is to: A) measure how much the government spends as a percentage of the economy. If the government spends very little we can assume that it leans capitalist. B) measure how much the government spends as a percentage of the economy. If the government spends very little we can assume that it leans socialist. C) measure how much it protects private property rights. If the government protects them with...
what is one way of measuring risk in the stock market?
what is one way of measuring risk in the stock market?
It is difficult to determine a person’s body fat percentage accurately without immersing him or her...
It is difficult to determine a person’s body fat percentage accurately without immersing him or her in water. Researchers hoping to find ways to make a good estimate immersed 20 male subjects, then measured their waist shown in the table. Waist (in.) Body Fat (%) 32 6 36 21 38 15 33 6 39 22 40 31 41 32 35 21 38 25 38 30 33 10 40 20 36 22 32 9 44 38 33 10 41 27 34...
How can we measure body fat? Do individuals have different body types and how does that...
How can we measure body fat? Do individuals have different body types and how does that contribute to their risk of obesity? What are some of the causes of obesity? Why is it easier for men to lose weight than it is for women? Which one are you? And how did you get this body type?
discuss the normal metabolism of macronutrients in the body (CHO, PRO and FAT). Choose one of...
discuss the normal metabolism of macronutrients in the body (CHO, PRO and FAT). Choose one of the disorders bellw and discuss how the merabolism of each macronutrient (CHO, PRO and FAT) is altered
Discuss the normal metabolism of macronutrients in the body (CHO, PRO, and FAT). Choose one of...
Discuss the normal metabolism of macronutrients in the body (CHO, PRO, and FAT). Choose one of the disorders below and discuss how the metabolism of each macronutrient (CHO, PRO, and FAT) is altered. (Liver disease)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT