Write a function that will calculate the current persons bmi

Assignment Help C/C++ Programming
Reference no: EM131320287

Assignment

When writing C++ programs include comments in your code, make the program readable by indenting, use meaningful variable and function names, and produce meaningful output.

This assignment will be to write a bmi calculation program that interacts with the end user - using the guidelines and sample output below.

Program: 20 points - bmi.cpp

Write a program that will do the following:

? Write a main function that will use a FOR LOOP - define a constant integer TOTAL_PEOPLE equal to 4. Use this constant to control how many times your FOR LOOP loops. Within the FOR LOOP you will be calling each of the following functions you will write.

? Write a function that will prompt for the current person's weight in pounds and return that weight..

? Write a function that will prompt for the current person's height in FEET and INCHES and return total height in INCHES.

? Write a function that will calculate and return the current person's BMI

? BMI Formula = (pounds*703) / (inches * inches)

? If your pounds and inches are defined as integers instead of doubles, you will need to multiply them by 1.0 in the above formula to make them be treated as real numbers for the division (otherwise it will do integer division)

? Write a function that will calculate and return the BMI classification string based on the calculated BMI.

? (-infinity, 18.5)   "Underweight"
? [18.5, 25)          "Normal weight"
? [25, 30)             "Overweight"
? [30, +infinity)     "Obesity"

? Write a function that will print the results of the BMI function and the BMI classification. In this function when you print the BMI value use the cout formatting options fixed and setprecision(2) to properly display only 2 decimal places for the BMI value.

? Use the examples below to run your program with - you should get the same results.

Remember to write this in baby steps compiling a little bit at a time - do not try to write all the functions at once and run it, it is much easier to troubleshoot by adding only a few lines of code and compile to see how that works. For example on this program - write main first with no other functions - get main working with a for loop, that loops 4 times

-- use testing/debugging cout statements to prove that your loop is looping 4 times. Next create the function get_weight, call this function inside your for loop, you should see that it prompts you 4 times to enter the weight - put testing/debugging cout statement in main to prove that you correct prompted and returned back to main the weight. Do this same step of adding one function at a time and testing/debugging as you go --- add a few (1-9) lines not 10's/100's of lines before you compile and check what you just added, if you have a problem it is most likely in those last few lines of code you just added/changed.

Example program run:

Enter weight in pounds for person #1 : 138 Enter height (feet and inches) for person #1 : 6 2

Person #1 weighs 138 pounds and is 74 inches tall with a calculated BMI of 17.72 and a classification of: Underweight

Enter weight in pounds for person #2 : 175 Enter height (feet and inches) for person #2 : 5 9

Person #2 weighs 175 pounds and is 69 inches tall with a calculated BMI of 25.84 and a classification of: Overweight

Enter weight in pounds for person #3 : 245 Enter height (feet and inches) for person #3 : 6 0
Person #3 weighs 245 pounds and is 72 inches tall with a calculated BMI of 33.22 and a classification of: Obesity

Enter weight in pounds for person #4 : 142 Enter height (feet and inches) for person #4 : 5 4

Person #4 weighs 142 pounds and is 64 inches tall with a calculated BMI of 24.37 and a classification of: Normal weight

Reference no: EM131320287

Questions Cloud

Report on the balance sheet for the investment : Prepare the January 1 and December 31 general journal entries for XYZ Company - How much should the XYZ Company report on the balance sheet for the investment in Rayco at the end of 2014?
Consequences of the gregorian reforms : Starting in the 10th century, movements to reform the church began. Why was the church in need of reform, and what were the consequences of the Gregorian Reforms?
Implications did this have for superpower relations : Why did Gorbachev choose the United Nations as his forum for this speech? What did Gorbachev mean by "de-ideologizing relations among states? What implications did this have for superpower relations?
Create presentation in which you explore the security tasks : For this assessment, create a presentation in which you explore the security tasks that systems administrators should be knowledgeable about
Write a function that will calculate the current persons bmi : Write a function that will prompt for the current person's height in FEET and INCHES and return total height in INCHES. Write a function that will calculate and return the current person's BMI.
Differentiate between motherboard components : Use built-in diagnostics and monitoring. Differentiate between motherboard components. Compare and contrast RAM types and features
Implications did this have for superpower relations : Why did Gorbachev choose the United Nations as his forum for this speech? What did Gorbachev mean by "de-ideologizing relations among states? What implications did this have for superpower relations?
Draw depth-first tree that results when algorithm is applied : In Exercises 4.2.1 through 4.2.7, draw the depth-first tree that results when Algorithm 4.2.1 is applied to the graph shown below, starting at the specified vertex.
Discuss the overview of flexible forms of organizing : Your answer for this question should discuss the overview of flexible forms of organizing and include examples of organizations who those flexible forms

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd