Click here to Skip to main content
15,885,366 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: calculator Pin
Thomas Daniels17-Feb-13 4:42
mentorThomas Daniels17-Feb-13 4:42 
AnswerRe: calculator Pin
庄伟东17-Feb-13 15:30
庄伟东17-Feb-13 15:30 
QuestionHo to add auto scroll feature on Dialog box? Pin
VCProgrammer15-Feb-13 20:11
VCProgrammer15-Feb-13 20:11 
AnswerRe: Ho to add auto scroll feature on Dialog box? Pin
Richard MacCutchan15-Feb-13 22:21
mveRichard MacCutchan15-Feb-13 22:21 
GeneralRe: Ho to add auto scroll feature on Dialog box? Pin
VCProgrammer17-Feb-13 17:30
VCProgrammer17-Feb-13 17:30 
AnswerRe: Ho to add auto scroll feature on Dialog box? Pin
_Flaviu17-Feb-13 19:54
_Flaviu17-Feb-13 19:54 
QuestionClient Certificates in WinHTTP Pin
basementman15-Feb-13 9:27
basementman15-Feb-13 9:27 
QuestionPossible to resolve the question ... in a short time Pin
Haiathem alhmoud15-Feb-13 7:48
Haiathem 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 <time.h>
#include <stdlib.h>
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
jeron115-Feb-13 8:08 
AnswerRe: Possible to resolve the question ... in a short time Pin
David Crow16-Feb-13 14:56
David Crow16-Feb-13 14:56 
QuestionWindows 8 Modified Windows API List... Pin
Blake Miller15-Feb-13 7:35
Blake Miller15-Feb-13 7:35 
AnswerRe: Windows 8 Modified Windows API List... Pin
Richard MacCutchan15-Feb-13 22:18
mveRichard MacCutchan15-Feb-13 22:18 
Question_IID_IXMLHTTPRequest linker error Pin
Member 981141114-Feb-13 19:48
Member 981141114-Feb-13 19:48 
AnswerRe: _IID_IXMLHTTPRequest linker error Pin
Richard MacCutchan14-Feb-13 23:09
mveRichard MacCutchan14-Feb-13 23:09 
AnswerRe: _IID_IXMLHTTPRequest linker error Pin
David Crow15-Feb-13 5:31
David Crow15-Feb-13 5:31 
QuestionMCF Pin
FranksLIC14-Feb-13 10:55
FranksLIC14-Feb-13 10:55 
AnswerRe: MCF Pin
Jibesh14-Feb-13 11:12
professionalJibesh14-Feb-13 11:12 
AnswerRe: MCF Pin
jeron114-Feb-13 12:01
jeron114-Feb-13 12:01 
AnswerRe: MCF Pin
Maximilien15-Feb-13 1:20
Maximilien15-Feb-13 1:20 
AnswerRe: MCF Pin
SajeeshCheviry15-Feb-13 5:56
SajeeshCheviry15-Feb-13 5:56 
QuestionHosting .net window in MFC dialog Pin
Yunaless14-Feb-13 4:06
Yunaless14-Feb-13 4:06 
QuestionCView::OnDraw - related question Pin
tagopi13-Feb-13 22:29
tagopi13-Feb-13 22:29 
AnswerRe: CView::OnDraw - related question Pin
Sivaraman Dhamodharan13-Feb-13 23:26
Sivaraman Dhamodharan13-Feb-13 23:26 
GeneralRe: CView::OnDraw - related question Pin
tagopi13-Feb-13 23:40
tagopi13-Feb-13 23:40 
SuggestionRe: CView::OnDraw - related question Pin
Richard MacCutchan13-Feb-13 23:51
mveRichard MacCutchan13-Feb-13 23:51 

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

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