Click here to Skip to main content
11,705,098 members (58,010 online)

C / C++ / MFC

 
AnswerRe: calculator Pin
ProgramFOX17-Feb-13 4:42
member ProgramFOX17-Feb-13 4:42 
AnswerRe: calculator Pin
庄伟东17-Feb-13 15:30
member庄伟东17-Feb-13 15:30 
QuestionHo to add auto scroll feature on Dialog box? Pin
VCProgrammer15-Feb-13 20:11
groupVCProgrammer15-Feb-13 20:11 
AnswerRe: Ho to add auto scroll feature on Dialog box? Pin
Richard MacCutchan15-Feb-13 22:21
mvpRichard MacCutchan15-Feb-13 22:21 
GeneralRe: Ho to add auto scroll feature on Dialog box? Pin
VCProgrammer17-Feb-13 17:30
groupVCProgrammer17-Feb-13 17:30 
AnswerRe: Ho to add auto scroll feature on Dialog box? Pin
Flaviu217-Feb-13 19:54
memberFlaviu217-Feb-13 19:54 
QuestionClient Certificates in WinHTTP Pin
basementman15-Feb-13 9:27
memberbasementman15-Feb-13 9:27 
QuestionPossible to resolve the question ... in a short time Pin
Haiathem alhmoud15-Feb-13 7:48
memberHaiathem alhmoud15-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.
AnswerRe: Possible to resolve the question ... in a short time Pin
jeron115-Feb-13 8:08
memberjeron115-Feb-13 8:08 
AnswerRe: Possible to resolve the question ... in a short time Pin
DavidCrow16-Feb-13 14:56
memberDavidCrow16-Feb-13 14:56 
QuestionWindows 8 Modified Windows API List... Pin
Blake Miller15-Feb-13 7:35
memberBlake Miller15-Feb-13 7:35 
AnswerRe: Windows 8 Modified Windows API List... Pin
Richard MacCutchan15-Feb-13 22:18
mvpRichard MacCutchan15-Feb-13 22:18 
Question_IID_IXMLHTTPRequest linker error Pin
Member 981141114-Feb-13 19:48
memberMember 981141114-Feb-13 19:48 
AnswerRe: _IID_IXMLHTTPRequest linker error Pin
Richard MacCutchan14-Feb-13 23:09
mvpRichard MacCutchan14-Feb-13 23:09 
AnswerRe: _IID_IXMLHTTPRequest linker error Pin
DavidCrow15-Feb-13 5:31
memberDavidCrow15-Feb-13 5:31 
QuestionMCF Pin
FranksLIC14-Feb-13 10:55
groupFranksLIC14-Feb-13 10:55 
AnswerRe: MCF Pin
Jibesh14-Feb-13 11:12
memberJibesh14-Feb-13 11:12 
AnswerRe: MCF Pin
jeron114-Feb-13 12:01
memberjeron114-Feb-13 12:01 
AnswerRe: MCF Pin
Maximilien15-Feb-13 1:20
memberMaximilien15-Feb-13 1:20 
AnswerRe: MCF Pin
SCProrammer15-Feb-13 5:56
memberSCProrammer15-Feb-13 5:56 
QuestionHosting .net window in MFC dialog Pin
Yunaless14-Feb-13 4:06
memberYunaless14-Feb-13 4:06 
QuestionCView::OnDraw - related question Pin
tagopi13-Feb-13 22:29
membertagopi13-Feb-13 22:29 
AnswerRe: CView::OnDraw - related question Pin
Sivaraman Dhamodharan13-Feb-13 23:26
memberSivaraman Dhamodharan13-Feb-13 23:26 
GeneralRe: CView::OnDraw - related question Pin
tagopi13-Feb-13 23:40
membertagopi13-Feb-13 23:40 
SuggestionRe: CView::OnDraw - related question Pin
Richard MacCutchan13-Feb-13 23:51
mvpRichard MacCutchan13-Feb-13 23:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

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


Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 28 Aug 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid