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
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
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
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education