123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
#include <string> #include<iostream> using namespace std; int main() {srand(time(0)); string t; char playAgain='y'; cout <<"I am the Questionator! Ask me any Question and I will Answer!" << endl; cout <<"(Yes/No only)"<<endl; while (playAgain !='n') { int x =1+rand()%8; cout <<" "<<endl; cout << "Ask the Question: "<<endl; cout <<" "<<endl; getline (cin,t); cout <<" "<<endl; if (x == 1) { cout << "Certainly!"<<endl; } if (x == 2) { cout << "Not really!"<<endl; } if (x == 3) { cout << "Probably not!"<<endl; } if (x == 4) { cout << "Maybe!"<<endl; } if (x ==5) { cout << "Probably"<<endl; } if (x ==6) { cout << "No way!"<<endl; } if (x ==7) { cout << "Possibly!"<<endl; } if (x ==8) { cout << "Unlikely"<<endl; } do{ cout << "Would you like to ask another question? y/n: "; cin >> playAgain; cout <<" "<<endl; }while (playAgain !='y' && playAgain !='n'); } cout <<" "<<endl; cout << "Thank you for playing a game by Anmol Sethi and Matthew Sonne!" << endl; system ("pause"); }