no, that makes sense.. i'll just throw all the code down. The assignment is to have the program assign a random cost of $5-$20 for used games and $25-50 for new games.
Code:
int main() {
int new_games, used_games, num_games, selection, counter;
double cost_new, cost_used;
srand(time(0));
printf("Welcome to UCF Games!\n");
printf("What would you like to do?\n");
printf("\t 1. Buy New Games.\n");
printf("\t 2. Buy Used Games.\n");
printf("\t 3. Quit.\n");
scanf("%d", &selection);
while (selection == 1){
switch (selection) {
case 1:
printf("How many New Games would you like to buy today?\n");
scanf("%d", &num_games);
}
for (counter=0; counter < num_games; counter++){
printf("The cost of game %d is $%.2lf\n", counter +1, cost_new);
cost_new = 25 + rand()%26;}
if(cost_new != 50) {
cost_new += rand()%100 * 0.01;}
break;}