Hi everyone,
I apologize in advance for the length. This is such a nit-picky question I'm rolling my eyes at it as I'm writing it.
The directions for this assignment are:
1. Create a class called Dice to represent a single cube. It should have a method called roll() that randomly selects a number from 1 to 6 for the value of the dice.
2. Create a
test main method for the Dice class that creates a Dice, and rolls it many times.
3. Can you keep track of how many times each number comes up? Describe how in a three or fewer sentences, or implement it in your main program.
4. Describe which number comes up the most often in a sentence.
Back your answer up with your statistics if possible.
The pieces I've highlighted in red are what I'm having trouble with. I've created a Dice program as follows.
My issues:
1) The output for the Dice program is showing 10,000 random #'s between 1 and 6.
(I.e. --
run:
3
1
6
4
3
2..............)
Shouldn't it look something like "Dice with 6 sides is showing 1, Dice with 6 sides is showing 4, .....etc.)?
And 2)
The only way I can figure out how to get instruction #3 correct is by adding a separate Dice Statistics class to my program, which I did here:
This gives me the output I need, but clearly the instructor wants this all lumped into the main Dice program. Am I right? Any help would be greatly appreciated.
Thanks