so i have a loop that will run x number of times and each time it will produce a prize which is a certain sum of money. I need to a way to sum all the money earned. I am thinking there should be a way to extract the prize one for each time the loop runs but i am not sure how to do that. if anybody could help thatd be great!
int main()
{
cout <<"Option A: Drop one chip into one slot" << endl;
cout <<"Option B: Drop multiple chips into one slot" << endl;
cout <<"Option C: Quite the program"<< endl;
cout <<"Select and option: ";
string user_choice;
cin >> user_choice;
int slot;
double location;
int chip_number;
if (user_choice == "A")
{
cout <<"Select a slot number (0-8) to drop your coin: ";
cin >> slot;
if (0<= slot && slot < 9)
{
int x=1;
location = slot;
}
else if ( user_choice == "B" )
{
cout << "Enter the number of chips you would like to play: ";
cin >> chip_number;
cout <<"Select a slot number (0-8) to drop your coin: ";
cin >> slot;
if (0<= slot && slot < 9)
{
int x=1;
location = slot;
int y =1;
int prize;
for (y=1; y<=chip_number ; y++)
{
for (x=1; x<=12; x++)
{
double r = rand()%(2)-.5;