Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Beginner C++ Programmer Oh dear....

Name: Anonymous 2008-02-26 10:36

So I have this project to write that involves a random number generator. The program is a simple dice-rolling simulator, in which the seed is asked for, then the number of times you want it to roll dice. Then it should output the dice rolls, and give probability for each number. Here's what my teacher gave me notes for on probability:
P(1)=#'s of 1's rolled/total# rolls
P(2)=
P(3)=, etc. 

We have just started programming and I have no idea what the hell I'm doing. Anything at this point would help a lot.

Name: Anonymous 2008-02-26 10:52

We have just started programming and I have no idea what the hell I'm doing.

Read SICP

Name: Anonymous 2008-02-26 11:01

>>1
Create a function that returns a random number between 1 and 6 inclusive - this will emulate your dice roll.

Create an array of six elements, and set them all to zero - these will be your counters for each roll result.

Roll the dice as many times as you need, and after each roll, increase the resultant number in the array by one.




Name: Anonymous 2008-02-26 11:04

>>3
DON'T HELP HIM!!!

Name: Anonymous 2008-02-26 12:42

and set them all to zero
Java does this automatically

ENTERPRISE

Name: Anonymous 2008-02-26 13:19

add a newline to the end of the string
Haskell does this automatically.

HASKELL. HASKELL NOMADS

Name: Anonymous 2009-03-06 10:57


The printf modifier only?

Name: Anonymous 2010-12-06 9:51

Back to /b/, ``GNAA Faggot''

Name: Anonymous 2010-12-21 17:25

Name: Anonymous 2011-02-04 15:10

Don't change these.
Name: Email:
Entire Thread Thread List