Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I am a total newbie, and I am pretty hung up on the implementation of a random number generation into a program I am supposed to write (C++). If I am given information about the probability of possible outcomes, how do I use a random number generator to predict the future events based on said probability figures?
The program is based on the next years baseball batting pcts and such. After rereading again and again I can only assume that I use each of the possibilities that add up to 100 percent, and use each of these separately ie. the probability for a single is 20 percent, so i use if(x >= 1 && x <=20) then blah blah blah.... Kind of stuck... Any way someone can push me in the right direction?