Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(JAVA) Write a program in JAVA that calculates and prints the BFP and BFP category for a person; the program allows user to enter values

(JAVA) Write a program in JAVA that calculates and prints the BFP and BFP category for a person; the program allows user to enter values for the name, gender, age, BMI of the person,

I am stuck on this program and need assistance because I do not know where to start.

ASSIGNMENT DESCRIPTION:

The body mass index (BMI) is a measure of relative weight based on height and weight.

The body fat percentage (BFP) of a human or other living being is the total mass of fat divided by total body mass, multiplied by 100; body fat includes essential body fat and storage body fat. Essential body fat is necessary to maintain life and reproductive functions.

Write a program that calculates and prints the BFP and BFP category for a person; the program allows user to enter values for the name, gender, age, BMI of the person,

The formula for BFP is:

Child body fat percentage = 1.51 * BMI - 0.70*age 3.6* gender +1.4

Adult body fat percentage = 1.20 * BMI +0.23 * age 10.8 *gender 5.4

where gender is 0 for females and 1 for males.

If the user is 15 years old or younger, he/she will be considered as Child in calculation.

If the user is older than 15, he/she will be considered as Adult in calculation.

Implement the following steps:

Prompts user to enter name (a String). (15 points)

Prompts user to enter gender (a int or String). (10 points)

Prompts user to enter age (a int). (10 points)

Prompts user to enter BMI (a double). (10 points)

Calculate the BFP using the given formula and defined variables (arithmetic expressions). (25 points)

Determine the BFP category based on the following table. (if-elseif statement) (25 points)

Description

Women

Men

Essential fat

1013%

25%

Athletes

1420%

613%

Fitness

2124%

1417%

Average

2531%

1824%

Obese

32%+

25%+

Print out name, age, gender, BMI, BFP and BFP category of the person. (5 points)

Sample output:

Welcome, David

You are 21 years old

You are a Male adult

Your BMI is 24.5

Your BFP is 18.03%

You are Average

Extra points (5 points): Add comments for each statement to explain function of each statement.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

More Books

Students also viewed these Databases questions

Question

Create a summary of experience

Answered: 1 week ago