I can't seem to figure out what I am doing wrong here. I can either get my loop to play indefinitely, not replay at all, or not initiate in the begging.
I'm very new to programming & would appreciated any help.
Code:
int main()
{
int weight ; // weight in pounds
int height ; // height in inches
float BMI ; // Body Mass Index
bool DoItAgain ;
char Repeat ;
do
{ My Programming code here which is a BMI Calculator
with several IF options
if (BMI >= 40.0)
cout << "You are severely obese." << endl ;
cout << " " << endl ;
cout << "Would you like to enter a new height and weight? (y or n): " ;
cin >> Repeat ;
}
while (DoItAgain = true) ;
if ((Repeat == 'n'|| Repeat == 'N'))
DoItAgain = false ;
cout << "Goodbye" << endl ;
return 0 ;
}
then I have a function subprogram code which works fine.