When I run this program, on the surface everything seems fine. But when i type in multiple words, like 'hello there' it will do it twice. So if I space things each string (i guess) will generate its own little question and answer.. Sorry it's really hard for me to explain, but I'm sure you guys know what you're doing. :D
P.S This code is making fun of a close friend, I don't mean to offend. It seems pretty sloppy as well, sorry about that.
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <stdio.h>
usingnamespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
repeatme:
cout << "------------------------------------------------------------------------\n";
cout << "Is Kindle a homosexual? Please, tell my how you really feel. 'yes', or 'no'.\n";
string choice;
cin >> choice;
if (choice == "yes" || choice == "Yes")
{
cout << "Yes he is quite the homosexual, isn't he?\n";
repeat:
cout << "Would you like to try again?:";
string yesChoice;
cin >> yesChoice;
if (yesChoice == "yes" || yesChoice == "Yes")
{
goto repeatme;
}
else
{
if (yesChoice == "no" || yesChoice == "No")
{
cout << "Okay, have a good day then.\n";
system ("PAUSE");
return 0;
}
cout << "Error, you did not type 'yes', or 'no'.\n";
goto repeat;
}
}
else
{
if (choice == "no" || choice == "No")
{
cout << "What? you must've typed that wrong. Or you're Kindle. Take your pick.\n";
goto repeat;
}
cout << "Please enter a valid answer. A simple 'yes', or 'no' will do. Try again.\n";
goto repeatme;
}
}