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?
- Hot
- Active
-
How To: Use arrays when programming in C++
-
How To: Create a Socket in the C Programming Language under Unix
-
How To: Use the string class when programming in C++
-
How To: Store text in an array when programming in C++
-
How To: Create and use char arrays when using C++
-
How To: Build advanced arrays when coding in the C++ programming language
-
How To: Use namespace std when writing code in C++
-
How To: Generate 3D terrain in Microsoft Visual C++
-
How To: Draw text with OpenGL in Microsoft Visual C++
-
How To: Use an octree to solve collision detection problems in Visual C++
-
How To: Simulate transparent objects with alpha blending in Microsoft Visual C++
-
How To: Draw reflections with OpenGL in Microsoft Visual C++
-
How To: Create a fog effect when creating an OpenGL program in MS Visual C++
-
How To: Speed up an OpenGL program with backface culling
-
How To: Download and install C++ and a programming IDE on a Windows PC
-
How To: Write code and program in C++
-
How To: Create a spinning 3D cube with OpenGL, GLUT and C++
-
How To: Add texture to 3D objects with OpenGL for C++
-
How To: Add lighting to 3D scenes with OpenGL for C++
-
How To: Add colors to 3D scenes with OpenGL for C++
Be the First to Respond
Share Your Thoughts