Trying to come up with a code that will give you your circumference value by taking the measurements of your waist and hips and subtracting the measurement of your neck but I'm getting several very weird errors. Most of them in regards to !=. Can someone please take a look and let me know what I am doing wrong.
/****************************************************/
/* File: Final Project */
/* */
/* Created by: <<removed by request>> */
/* Date: April 07, 2010 */
/* */
/* Program to compute circumference values */
/* */
/* Inputs: (keyboard) */
/* Three positive float (n, w & h) */
/* */
/* Output: */
/* Corresponding circumference value */
/* for females ((w+h)-n) */
/* */
/* Algorithm: see attached description */
/****************************************************/
#include <iostream>
using namespace std ;
float mbrcircumval(float n, float w, float h) ; //
string mbrname, response
int main()
{
cout << "Would you like to enter measurements for an individual?" ;
cout << "You must enter yes or no : " ;
cin >> response ;
while (response != no)
{
// read in member's
cout << "Please enter the name of the member whose measurements"
cout << "you are entering : " ;
cin >> mbrname ;
float n, w, h ; //
float result ;
cout << endl ;
// read in n, w & h
cout << "Enter n (the members neck measurement in inches) : " ;
cin >> n ;
cout << "Enter w (the members waist measurement in inches) : " ;
cin >> w ;
cout << "Enter h (the members hip measurement in inches) : " ;
cin >> h ;
result = mbrcircumval (n, w, h) ;
cout << "The circumference value for " << mbrname << "is" <<
<< " = " << result << endl ;
}
}
// ********************************************************
float mbrcircumval(float n, float w, float h)
/* Computes the circumference value */
/* */
/* Inputs: */
/* n, w, h (floats) */
/* */
/* Output: */
/* circumference value (float) */
{
if ((h+w) < n)
{
return(0) ;
}
else
{
return ((w+h)-n) ;
}
}