C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 4, Problem 18PE

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 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
  • A6 = 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 = wrist measurement x 4.15
  • B = A1 – A2
  • Body fat = body weight – B
  • Body fat percentage = body fat x 100/body weight

Write a program to calculate the body fat of a person.

Blurred answer
Students have asked these similar questions
A nutritionist who works for a fitness club helps members by evaluating their diets. As part of her evaluation, she asks members for the number of fat grams and carbohydrate grams that they consume in a day. Then, she calculates the number of calories that result from the fat using the following formula:                       Calories from fat = Fat grams × 9Next, she calculates the number of calories that result from the carbohydrates using the following formula:                       Calories from carbs = Carbs grams × 4Create an application that will make these calculations. In the application, you should have the following methods:• FatCalories–This method should accept a number of fat grams as an argument and return the number of calories from that amount of fat.• CarbCalories–This method should accept a number of carbohydrate grams as an argument and return the number of calories from that amount of carbohydrates.
Suppose you save $100 each month in a savings account with annual interest rate 3.75%. Thus, the monthly interest rate is 0.0375/12 = 0.003125. After the first month, the value in the account becomes 100 * (1 + 0.003125) = 100.3125, after the second month, the value in the account becomes (100 + 100.3125) * (1 + 0.003125) = 200.938, after the third month, the value in the account becomes (100 + 200.938) * (1 + 0.003125) = 301.878 and so on. Write a Java program that prompts the user to enter a monthly saving amount and displays the account value after the sixth month. (You will use a loop to simplify the code and display the account value for any month.)  Sample Output:Enter the monthly saving amount: 100After the first month, the account value is 100.3125After the second month, the account value is 200.9384765625After the third month, the account value is 301.8789093017578Note: The computation should be until 12 months.
The interest paid on a savings account is compounded daily. This means that if you start with startbal dollars in the bank, at the end of the first day you’ll have a balance ofstartbal * (1 + rate/365)dollars, where rate is the annual interest rate (0.10 if the annual rate is 10 percent). At the end of the second day, you’ll havestartbal * (1 + rate/365) * (1 + rate/365)dollars, and at the end of n days you’ll havestartbal * (1 + rate/365)ndollars. Write a program that processes a set of data records, each of which contains values for rate, startbal, and n and computes the final account balance.
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY