Forum Thread: Trying to Figure Out Random Number Generation with a Vector...

So I have an assignment which requires me to create a random number generator with some specifics. I have to use "double r = (((double) rand() / (double) RANDMAX) (max - min)) + min ;"as my number generator, which is fine, but I have to do it using a vector, and as I have gone through 90% or more of the vector I have to reshuffle and start from the beginning. I can generate random numbers just fine with a vector, but can't get it to work with this prescribed code, and I have no idea how you look to see that you've hit 90% of all possible numbers. I've been working on this for a couple weeks now and I am just lost. The sad part is that the assignment isn't really about the random numbers, its showing I can slap all of into a class, which is actually the easy part, but since I had a long break (several years), between the first class and this new one, I tend to struggle with the easy stuff. Can anyone help walk me through this?

Our Best Phone Hacks

Gadget Hacks' tips — delivered daily.

Be the First to Respond

Share Your Thoughts