Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Mission #8 CS 1400 -Hiltoin Body mass index is a measure of whether someone's weight is appropriate for their height. A body-mass-index value between 19

image text in transcribed

Mission #8 CS 1400 -Hiltoin 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: 704 x weightlnPounds heightInInches Implement a program that prompts the user for height and weight values and displays the associated body mass index Perform input validation by making sure that the user enters positive numbers for height and weight. Use error handling to catch any invalid input. See the sample session for details Sample session Enter height in inches: hi Invalid inches value. Must be a decimal number. Re-enter height in inches: 0 Invalid inches value. Must be positive. Re-enter height in inches: 69.25 Enter weight in pounds: dog Invalid pounds value. Must be a decimal number. Re-enter weight in pounds: -3 Invalid pounds value. Must be a decimal number. Re-enter weight in pounds: -20 Invalid pounds value. Must be positive. Re-enter weight in pounds: 150.5 Height 69.25" Weight 150.5 pounds Body mass index22.1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

Public key encryption uses teo keys. True or false

Answered: 1 week ago