12,396,461 members (35,836 online)

# C / C++ / MFC

 Re: Ho to add auto scroll feature on Dialog box? VCProgrammer17-Feb-13 17:30 VCProgrammer 17-Feb-13 17:30
 Re: Ho to add auto scroll feature on Dialog box? Flaviu217-Feb-13 19:54 Flaviu2 17-Feb-13 19:54
 Client Certificates in WinHTTP basementman15-Feb-13 9:27 basementman 15-Feb-13 9:27
 Possible to resolve the question ... in a short time Haiathem alhmoud15-Feb-13 7:48 Haiathem alhmoud 15-Feb-13 7:48
 ) If two dice are rolled. what is the probability of getting (1, 2), or (2, 3) and so on. We can answer these questions analytically, but you need to write a code to verify the results. You can do that following the steps: a. Write a function rollDices that takes two parameters as output parameters (return values through them). The function when called should return two random integers, each one between 1 and 6, where each one represent the value of a rolled die. Use the following code to generate a random number between a and b. We seed the random number generator using srand function as shown below.#include #include using namespace std; //... you other functions ... int main () { // seed random number generator srand ( time(NULL) ); // your other code here // generate a random number between 1 and 10 int randomNumber = rand() % 10 + 1; } b. Write another function rollProb that takes a two dimensional array 6x6 and an integer numberOfRolls. The function should call the rollDices function numberOfRolls times, and for each call it should increment the corresponding cell in the array. c. Your main program should prompt the user for the numberOfRolls and calls the function rollProb and then prints the probability of obtaining each pair of values. Try it with 4 different number of rolls: 100, 1000, 10000, 100000. I will explain it more in class.
 Re: Possible to resolve the question ... in a short time jeron115-Feb-13 8:08 jeron1 15-Feb-13 8:08
 Re: Possible to resolve the question ... in a short time DavidCrow16-Feb-13 14:56 DavidCrow 16-Feb-13 14:56
 Windows 8 Modified Windows API List... Blake Miller15-Feb-13 7:35 Blake Miller 15-Feb-13 7:35
 Re: Windows 8 Modified Windows API List... Richard MacCutchan15-Feb-13 22:18 Richard MacCutchan 15-Feb-13 22:18
 _IID_IXMLHTTPRequest linker error Member 981141114-Feb-13 19:48 Member 9811411 14-Feb-13 19:48
 Re: _IID_IXMLHTTPRequest linker error Richard MacCutchan14-Feb-13 23:09 Richard MacCutchan 14-Feb-13 23:09
 Last Visit: 31-Dec-99 18:00     Last Update: 24-Jul-16 19:25 Refresh « Prev1...988989990991992993994995996997 Next »

General    News    Suggestion    Question    Bug    Answer    Joke    Praise    Rant    Admin

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 25 Jul 2016