I am attempting to program a console app which simulates opening up a case in CS:GO. First the program generates a random number 1-100 and then depending on that number displays a certain skin that the play is given. However, after struggling to figure out a way to make an if statement that accepts multiples values I am struggling on the else part for accepting other values.
I am currently experiencing issues at line 72 where I am getting the error, "expected '}' before 'else' and 'gWeaponGen' was not declared in this scope.
I am new to programming and started just a few days ago so I am at a loss for the reasoning behind this issue so I would appreciate any help. Also because I am a beginner I expect the code to be very sloppy and inefficient, I ask you kindly to help with me with my main problem before recommending other potential tweaks. Once again I appreciate any assistance I can get.
I didn't even know it was possible to else/if and I'm glad you mention a better way to manage the if statement. I had no idea if it would even work the way I had it.
1 2 3 4 5
int gWeapon;
srand( time(0));
gWeapon=rand()%100+1;
int gWeaponGen = gWeapon;
if(gWeaponGen > 0 && < 8)