Intro to computer science? C++ question?

Intro to computer science? C++ question?




I'm having the worst time with this. I need to add a "while loop" for a yes and no if the user wants to ask another question, a if statement, let the user be able to just get a random respond, and if the user picks a number outside of what given they will be told that wasn't a chose. Help?????



This is what I have so far



#include <iostream>

#include <stdio.h>

#include <time.h>

using namespace std;



string answers[8] = {

"No",

"Yes",

"Your guess is as good as mine",

"It looks like there's a chance",

"If you believe anything is possible",

"Try again","Give me another one","I believe it's your lucky day"

};





string question="";



int main() {



int n;



cout << "Ask me a question and I'll tell you the future" << endl;

cin >> question;



cout << "Choose between 1-8:";

cin >> n;



cout << answers[n];



return 0;

}





No Answers Posted Yet.