cout<<"Do You Wish to Quit(Y or N):";
cin>>response;
response=toupper(response);
do { getsides(side1,side2,side3);
shape=determineShape(side1,side2,side3,shape);
displayShape(shape);
}
while(response =='N');
return 0;
}
void getsides(int&side1,int&side2,int&side3)
{
cout<<"Enter A Side of a Triangle: ";
cin>>side1;
cout<<"Enter The Second Side of a Triangle: ";
cin>>side2;
cout<<"Enter The Third Side of a Triangle: ";
cin>>side3;
}
void displayShape(triangletype shape)
{
if(shape==equilateral)
cout<<"This Triangle is Equilateral."<<endl;
else if(shape==isosceles)
cout<<"This Triangle is Isosceles."<<endl;
else if(shape==scalene)
cout<<"This Triangle is Scalene."<<endl;
else
cout<<"This Is Not A Triangle."<<endl;
}
it will run my program correctly then regardless of the loop it will display the void getsides cout statement then give the press any key to continue. I tried to debug and I know the error is in the loop,i cant just find out how to correct it.
You never prompt if they want to quit inside the loop, so the loop will run forever if they input 'N' the first time, once if they input anything else.