Question
PART II: Calculating a BMI (Body Mass Index) Declare the following constants above your main: Data Type Variable Value Double CONVERT_POUND_TO_KILOGRAMS 0.453592 Double CONVERT_INCHES_TO_METERS 0.0254
PART II: Calculating a BMI (Body Mass Index) Declare the following constants above your main: Data Type Variable Value Double CONVERT_POUND_TO_KILOGRAMS 0.453592 Double CONVERT_INCHES_TO_METERS 0.0254 Declare the following variables: Data Type Variable Integer inputInches Integer inputWeight Double kilograms Double meters Double bodyMassIndex Integer outputInches Integer outputFeet Integer calculationCounter (Set this variable to 0) Integer totalPonunds (Set this variable to 0) Integer totalInches (Set this variable to 0) Integer totalWeight (Set this variable to 0) In part two you will use a repeat process to calculate two BMI values. Inputs: - Have the user enter a weight in pounds from the keyboard - Have the user enter their height in inches For both inputs, use an if-statement to determine if the number is negative. If it is negative, multiply by -1 and print an error message stating that the number has been converted to a positive. Processing: - To convert your body weight from pounds to kilograms multiply by the constant CONVERT_POUND_TO_KILOGRAMS. - To convert your height from inches to meters multiply by the constant CONVERT_INCHES_TO_POUNDS. - Calculate the body mass index with the following formula: [kilograms / (meters * meters)] - Add input values (inputInches and inputWeight) to the accumulators. - Use the modulus operator and integer by integer division to calculate outputInches and outputFeet Output BMI Calculations: Print the results to the screen. (You must use setw to format your output) See example output below. Output Accumulators: After printing the results for both calculations, print the accumulator results. See example output below. Produce the following output: Example Output: You need to put the Main Documentation Block (IPO) at the top of your program
// I have it done up until the "- Add input values (inputInches and inputWeight) to the accumulators." I just need some guidance through the rest of it.
Please display C++ code. Thank you.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started