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
icon
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:

  1. Their gender ('m' or 'M' for male, 'f' or 'F' for female)

If male was entered, additionally prompt the user to input:

  1. Their body weight (in pounds)
  2. Their waist measurement at fullest point (in inches)

If female was entered, additionally prompt the user to input:

  1. Their body weight (in pounds)
  2. Their wrist measurement at fullest point (in inches)
  3. Their waist measurement at navel (in inches)
  4. Their hip measurement at fullest point (in inches)
  5. Their forearm measurement at fullest point (in inches)

The program then outputs:

  1. Body fat
  2. Body fat percentage
Correct output for test
cases
0.00
out of
10.00
Click the checkbox above
to attempt this task.
Checks
Test Case
Incomplete
Test case female
Attempt this task to view the check
results.
Test Case
Incomplete
Test case male
Attempt this task to view the check
>
Transcribed Image Text:Correct output for test cases 0.00 out of 10.00 Click the checkbox above to attempt this task. Checks Test Case Incomplete Test case female Attempt this task to view the check results. Test Case Incomplete Test case male Attempt this task to view the check >
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Math class and its different methods
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning