Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fat Burning Heart Rate and BMI Calculator Write a program that calculates an adult's fat-burning heart rate and BMI. The fat-burning heart rate is calculated

Fat Burning Heart Rate and BMI Calculator

Write a program that calculates an adult's fat-burning heart rate and BMI. The fat-burning heart rate is calculated by subtracting the person's age from 220. The result of this is the maximum heart rate and for fat burning 70% of the maximum would be needed. For example if the age entered is 40 then the maximum heart rate is 180 and 70% of this 126 bpm. This would be the persons fat burning heart rate.

Body mass index is a measure of whether someone’s weight is appropriate for their height. A body-mass-index value between 19 and 25 is considered to be in the normal range. Here’s the formula for calculating body mass index:

Perform input validation using exception handling by making sure the user enters only numbers (no strings!) and that those numbers are positive. See the sample for details.

Sample session:

Enter age: fortyInvalid age. Must be a number.Re-enter age: 40Enter height in inches: hiInvalid inches value. Must be a number.Re-enter height in inches: 0Invalid inches value. Must be positive.Re-enter height in inches: 69.25Enter weight in pounds: dogInvalid pounds value. Must be a number.Re-enter weight in pounds: -3Invalid pounds value. Must be positive.Re-enter weight in pounds: -20Invalid pounds value. Must be positive.Re-enter weight in pounds: 150.5Age = 40Height = 69.25"Weight = 150.5 poundsFat Burning Heart Rate = 126 bpmBody Mass Index = 22.1

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

Design Operation And Evaluation Of Mobile Communications

Authors: Gavriel Salvendy ,June Wei

1st Edition

3030770249, 978-3030770242

More Books

Students also viewed these Programming questions