#include <iostream>
using namespace std;
int main()
{
float height;
float weight;
int age;
float hatSize;
float jacketSize;
float waistSize;
char answer;
cout << "Please enter your height in inches.\n";
cin >> height;
cout << "Please enter your weight in pounds.\n";
cin >> weight;
cout << "Please enter your age.\n";
cin >> age;
do
{
cout << "Your hat size is " << (weight / height) * 2.9 << ".\n";
if (age > 30)
{
cout << "Your jacket size is " << ((height * weight) / 288) + (((age - 30) / 10) / 8) << " inches.\n";
}
else
{
cout << "Your jacket size is " << ((height * weight) / 288) << " inches.\n";
}
if (age > 28)
{
cout << "Your waist is " << (weight / 5.7) + ((age - 28) / 10) << " inches.\n";
}
else
{
cout << "Your waist is " << (weight / 5.7) << " inches.\n";
}
cout << "Again? (yes/no)\n";
cin >> answer;
} while (answer == 'yes');
return 0;
}
I need the program to repeat itself whenever the user inputs "yes" at (cin >> answer;). I've tried multiple ways and none have worked. Right now, it will not compile. Here's the error:
hw3_ch3_jforbes.cpp:39:21: warning: multi-character character constant
hw3_ch3_jforbes.cpp: In function ‘int main()’:
hw3_ch3_jforbes.cpp:39: warning: comparison is always false due to limited range of data type