Hiya Guys!!!
Am hoping you guys can tell me what I'm doing wrong. My Code compiles, and seems to run OK up until it gets to the "if" statement towards the end. Instead of waiting for a response it just closes.
int main()
{
cout << "\n\t\tWelcome to Doc's gas figure out thingy!\n";
Car car;
bool another = true;
while(another)
{
Car next;
next.drive();
cout << "\n\n\n\t\t\tHere are your results ";
next.print_result();
cout << "\n\n\t\t\tAnother Car? (y/n): ";
string response;
getline(cin, response);
if (response == "y")
another = true;
else
}
return(0);
I've tried ... if (response != "y") another = false ... as well with the same result.
Any assistance would be greatly appreciated.