I am new to using C++, just started learning a little while ago. So, what I've been trying to do[I didnt think it would be to difficult], was to have the computer randomly choose one of the questions I have set up, and then depending on what question was chosen, store the answer in the create variable. So far, this is what i have.
A few notes:
using namespace std;
string name,birthday,favColor,country,petName,birthPlace,favBand, SendTo;
int age, favNumber, IQ, selected, i;
string question ;
question = "What is your name?";;
question = "When is your birthday?";
question = "What is your favourite color?";
question = "What country do you live in?";
question = "How old are you?";
question = "What is your favourite number?";
question = "How many friends do you have?";
question = "Do you have any pets?";
question = "Where were you born?";
question = "What is your I.Q?";
question = "What is your favourite band?";
if (i < 10)
selected = (rand() % (10-1+1))+1;
case 0:SendTo = name;
case 1:SendTo = birthday;
case 2:SendTo = favColor;
case 3:SendTo = country;
case 4:SendTo = age;
case 5:SendTo = favNumber;
cout << question[selected];
cin >> SendTo;
1) I wasnt entirely sure on how to make a random number, so I googled it...and I dont know how that works exactly.
2) Also, the problem is that this code is NOT displaying anything. It will run, but, its not displaying anything.
3) Not sure if its important[I dont think it is], but im using Quincy 2005 to write this.