12,948,385 members (69,858 online)

# C / C++ / MFC

 Re: calculator ProgramFOX17-Feb-13 4:42 ProgramFOX 17-Feb-13 4:42
 Re: calculator 庄伟东17-Feb-13 15:30 庄伟东 17-Feb-13 15:30
 Ho to add auto scroll feature on Dialog box? VCProgrammer15-Feb-13 20:11 VCProgrammer 15-Feb-13 20:11
 Re: Ho to add auto scroll feature on Dialog box? Richard MacCutchan15-Feb-13 22:21 Richard MacCutchan 15-Feb-13 22:21
 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
 Re: _IID_IXMLHTTPRequest linker error DavidCrow15-Feb-13 5:31 DavidCrow 15-Feb-13 5:31
 MCF FranksLIC14-Feb-13 10:55 FranksLIC 14-Feb-13 10:55
 Re: MCF Jibesh14-Feb-13 11:12 Jibesh 14-Feb-13 11:12
 Re: MCF jeron114-Feb-13 12:01 jeron1 14-Feb-13 12:01
 Re: MCF Maximilien15-Feb-13 1:20 Maximilien 15-Feb-13 1:20
 Re: MCF SCProrammer15-Feb-13 5:56 SCProrammer 15-Feb-13 5:56
 Hosting .net window in MFC dialog Yunaless14-Feb-13 4:06 Yunaless 14-Feb-13 4:06
 CView::OnDraw - related question tagopi13-Feb-13 22:29 tagopi 13-Feb-13 22:29
 Re: CView::OnDraw - related question Sivaraman Dhamodharan13-Feb-13 23:26 Sivaraman Dhamodharan 13-Feb-13 23:26
 Re: CView::OnDraw - related question tagopi13-Feb-13 23:40 tagopi 13-Feb-13 23:40
 Re: CView::OnDraw - related question Richard MacCutchan13-Feb-13 23:51 Richard MacCutchan 13-Feb-13 23:51
 Last Visit: 31-Dec-99 18:00     Last Update: 24-May-17 20:09 Refresh « Prev1...440441442443444445446447448449 Next »