View Single Post
Join Date: Jun 2008
Posts: 13
Reputation: cmatos15 is an unknown quantity at this point 
Solved Threads: 0
cmatos15 cmatos15 is offline Offline
Newbie Poster

Re: Help with rolling dice problem

 
0
  #4
Jul 25th, 2008
Originally Posted by ArkM View Post
Well, it's so simple. You have integers in range 2..12. Declare an array of integers with size 13 (you may use indicies from 0 to 12). Initialize it with zeroes then add 1 to array[sum] element in the simulation main loop.
Use rand() with a proper scaling to get values in range 1..6 (see rand help, use RAND_MAX value).
That's all.
Of course, you are familiare with basic C++ declarations and statements...
I think im getting confused when it says to /* Write a declaration of array exprected here. Assign an initializer list containing the expected values here. Use SIZE for the number of elements */

is that asking for
  1. int expected[ SIZE ] = { list containing expected values }

I guess im not sure what the expected values are, I posted the sample output to the lab and it has the expected values, but there in percentages and im not sure if thats what im suppose to list.
Reply With Quote