I need to store 25 different values (1, 5, 10, 25 etc. theres no pattern) in an array and then when the user picks a number q through 25 one of those values (randomly not the same one every time) needs to be chosen.
I know that I need to Create a new array, initialize them all to a sentinel value, get a random number between 0 and 24, and move the first to that value. If it's not the sentinel, it's been set, get another random value(and check it again...), and to this 24 times, and move the 25th value to the only open spot.
but how do I store the 25 values into an array before the program starts and before the randomizing?
I know that I need to Create a new array, initialize them all to a sentinel value, get a random number between 0 and 24, and move the first to that value. If it's not the sentinel, it's been set, get another random value(and check it again...), and to this 24 times, and move the 25th value to the only open spot.
but how do I store the 25 values into an array before the program starts and before the randomizing?
Comment