1.      Write a function that will return a random integer between 1 and 6 inclusive, to represent the rolling of one die (rolling a pair of dice is okay, but one red die and one blue die might make up a pair of dice).  Name your function dieToss or dieThrow. 

 

2.      Write another function called badDicePair that generates a random integer number between 2 and 12 inclusive.  Why is this function called badDicePair()?  Because it does NOT give a distribution that is anything like throwing two dice and adding the two dice face values together.  Notice below that the results for 7 (170) were almost 6 times that of 2 (31)and were more than 6 times that of 12 (26).  The results shown below are obtained by using the dieToss() or the dieThrow() function.  You will get obviously BAD results when you use the badDicePair() function that generates ONE RANDOM NUMBER between 2 and 12 instead of generating one random number between 1 and 6, which is what each die of a dice pair does independently of the other one.

 

3.      Write the macro that will reset all of the Counts back to 0 in each of the cells in column B, except for the cell that is done with a formula.  The B13 cell obviously would be done with the Excel Formula =SUM(B2:B12), right?  Name your macro ResetCounts, please.

 

 

4.      Write the macro that will roll the dice 1000 times and tally the appropriate counts for the sum of the two rolled dice.  Name your macro roll1000.

 

Write your groups solution on a separate sheet of paper so we can go over them later during the class today using the Elmo projector at the front of the room.

 

Turn in your individual solution to this assignment as follows, by Friday, October 13th.

1.      Screen snapshot of the program after running the macro 10 times (for a total of 10,000 total rolls.

2.      Macro code printout of all the VBA Subs and Functions that you used.

3.      Screen snapshot of the results when you modify the macro to use (to invoke) the one function that generates a random integer between 2 and 12 inclusive.  In other words, use the badDicePair() function instead of the dieToss() function.  The results here can just be for 1,000 tosses if you like.