"Il y a peu de choses qui me soient impossibles..."
D Doemer wrote:Because from my current standpoint, when I hit compile, it's giving me the same output as my Dice program -- I don't see any difference.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
D Doemer wrote:All I want the DiceStatistics class to do is exactly what he asked in questions 5 &6 -- none of this map, tree map, if, while, else, "would you like to add a dice?" junk.
5. Create a class called DiceStatistics to represent a pair of dice and the totals of their rolls.
It should have an array of two Dice as a private data member (these are the Dice from Problem 1).
It should also have, as a data member, an array of integers to represent the possible totals of rolling two dice.
The class should also have the following methods:
* initStats() to initialize all the totals to zero.
* rollOnce() to roll each die once, and add one to the correct totals element
* printStatistics() to print the number of times each total has come up over the number of runs
6. Create a test main method for the DiceStatistics class that creates a DiceStatistics, initializes the statistics, then rolls the dice many times (say, 10000 or so), and then prints the statistics.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:OK, so create an empty class. And compile.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
|