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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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

- **Score**: 0.00 out of 10.00

**Instructions:**
Click the checkbox above to attempt this task.

### Checks

1. **Test Case Female**
   - Status: Incomplete
   - Action: Attempt this task to view the check results.

2. **Test Case Male**
   - Status: Incomplete
   - Action: Attempt this task to view the check results.

Each test case has a dropdown option for more information once it is attempted. The interface shows incomplete tasks with a red dot indicator, prompting the user to complete the actions required.
Transcribed Image Text:### Correct Output for Test Cases - **Score**: 0.00 out of 10.00 **Instructions:** Click the checkbox above to attempt this task. ### Checks 1. **Test Case Female** - Status: Incomplete - Action: Attempt this task to view the check results. 2. **Test Case Male** - Status: Incomplete - Action: Attempt this task to view the check results. Each test case has a dropdown option for more information once it is attempted. The interface shows incomplete tasks with a red dot indicator, prompting the user to complete the actions required.
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education