One way to determine how healthy a person is, 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 X 0.732) + 8.987 A2 = wrist measurement (at fullest point) / 3.140 A3 = waist measurement (at navel) X 0.157 A4 = hip measurement (at fullest point) X 0.249 A5 = forearm measurement (at fullest point) X 0.434 B = A1 + A2 - A3 - A4 + A5 Body fat = body weight - B Body fat percentage = body fat X 100 / body weight Body fat formula for men: A1 = (body weight X 1.082) + 94.42 A2 = waist measurement X 4.15 B = A1 - A2 Body fat = body weight - B Body fat percentage = body fat X 100 / body weight Instructions Write a program to calculate the body fat of a person. Prompt the user to input: Their gender ('m' or 'M' for male, 'f' or 'F' for female) If male was entered, additionally prompt the user to input: Their body weight (in pounds) Their waist measurement at fullest point (in inches) If female was entered, additionally prompt the user to input: Their body weight (in pounds) Their wrist measurement at fullest point (in inches) Their waist measurement at navel (in inches) Their hip measurement at fullest point (in inches) Their forearm measurement at fullest point (in inches) The program then outputs: Body fat Body fat percentage
One way to determine how healthy a person is, 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 X 0.732) + 8.987 A2 = wrist measurement (at fullest point) / 3.140 A3 = waist measurement (at navel) X 0.157 A4 = hip measurement (at fullest point) X 0.249 A5 = forearm measurement (at fullest point) X 0.434 B = A1 + A2 - A3 - A4 + A5 Body fat = body weight - B Body fat percentage = body fat X 100 / body weight Body fat formula for men: A1 = (body weight X 1.082) + 94.42 A2 = waist measurement X 4.15 B = A1 - A2 Body fat = body weight - B Body fat percentage = body fat X 100 / body weight Instructions Write a program to calculate the body fat of a person. Prompt the user to input: Their gender ('m' or 'M' for male, 'f' or 'F' for female) If male was entered, additionally prompt the user to input: Their body weight (in pounds) Their waist measurement at fullest point (in inches) If female was entered, additionally prompt the user to input: Their body weight (in pounds) Their wrist measurement at fullest point (in inches) Their waist measurement at navel (in inches) Their hip measurement at fullest point (in inches) Their forearm measurement at fullest point (in inches) The program then outputs: Body fat Body fat percentage
Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter5: Looping
Section: Chapter Questions
Problem 17RQ
Related questions
Question
(This is for devc++ but I use mindmap from Cengage. I know it a little different. If you can't use Cengage, I suggest devc++ version 5.11)
One way to determine how healthy a person is, 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 X 0.732) + 8.987
- A2 = wrist measurement (at fullest point) / 3.140
- A3 = waist measurement (at navel) X 0.157
- A4 = hip measurement (at fullest point) X 0.249
- A5 = forearm measurement (at fullest point) X 0.434
- B = A1 + A2 - A3 - A4 + A5
- Body fat = body weight - B
- Body fat percentage = body fat X 100 / body weight
Body fat formula for men:
- A1 = (body weight X 1.082) + 94.42
- A2 = waist measurement X 4.15
- B = A1 - A2
- Body fat = body weight - B
- Body fat percentage = body fat X 100 / body weight
Instructions
Write a program to calculate the body fat of a person. Prompt the user to input:
- Their gender ('m' or 'M' for male, 'f' or 'F' for female)
If male was entered, additionally prompt the user to input:
- Their body weight (in pounds)
- Their waist measurement at fullest point (in inches)
If female was entered, additionally prompt the user to input:
- Their body weight (in pounds)
- Their wrist measurement at fullest point (in inches)
- Their waist measurement at navel (in inches)
- Their hip measurement at fullest point (in inches)
- Their forearm measurement at fullest point (in inches)
The program then outputs:
- Body fat
- Body fat percentage
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning