RandomRiddle

I have started writing a c++ code in which I must keep the program alive until the user ends it. I must also use a sturct, a vector, strings and a random generator and I'm not sure what to do next. Here's what I've got so far:




#include <iostream> // allows program to perform input and output
#include <string>
#include <vector>
#include <fstream>


using namespace std; // program uses names from the std namespace

struct game{
int Price;
string VideoGame;
string Company;
string RD;
char Genre;
};


int main()
{
string VG ="Assassins Creed III";
string C ="Ubisoft";
string rd="10/30/12";
char make='R';
int price = 45.00;

char RunGame = 'X';


game s1;
s1.Price = price;
s1.Genre = make;
s1.RD = rd;
s1.VideoGame=VG;
s1.Company=C;

do
{
//This is our block of code that the user will interact with.
cout<<C<<" "<<VG<<endl<<"RD: "<<rd<<" Price: "<<price<<endl<<endl;

cout<<s1.Company<<" "<<s1.VideoGame<<endl<<"RD: "<<s1.RD<<" Price: "<<s1.Price<<endl<<"Genre: "<<s1.Genre<<endl<<endl;


cout<<"Do you wish to run this game? :";

cout<<endl;
cin>>RunGame;
}while(toupper(RunGame) == 'X');


return 0;
}
Uhh, what next?

Well you said you need vector and random, put them in.
Topic archived. No new replies allowed.