Question
Asked by:
sarah_whitten
sarah_whitten
Rating : No Rating
Questions Asked: 9
Tutorials Posted: 0
 

$1.00 please help me understand how to make this program.

  • From Computer-Science: General-CS
  • Closed, but you can still post tutorials
  • Due on Aug. 01, 2009
  • Asked on Jul 29, 2009 at 6:44:35PM
Q:
(Dice rolling )
write an application to simulate the rollong of two dice. The application should use an object of class random. once to roll the first dice and again to roll the second dice. The sum of the two values should be calculated. Each dice can show an integer value from 1 to 6 so the sum of the values will vary from 2 to 12 with 7 being the most frequent sum and 2 to 12 the least frequent.The application should roll the dice 36,000 times. use a one dimensional array to tally the number of times each possible sum appears. Display the result in tabular format. Determine whethr the totals are reasonable(e.g., there are six ways to roll a seven, so approximately one sixth of the rolls should be seven. This would be in java programming.
 


   
   
   
   
 
Available Tutorials to this Question
Posted by:
Bazooka
Bazooka
Rating (52): A
Questions Asked: 0
Tutorials Posted: 152, earned $348.66
 

$5.00 From a professional program...Buy and get an A guranteed...!!!

  • This tutorial was purchased 1 time and hasn't been rated yet.
  • Posted on Jul 29, 2009 at 6:49:53PM
A:
Preview: ... ofessional program...Buy ...

The full tutorial is about 18 words long plus attachments.

Attachments:
dice.java (0K) (Preview)
Posted by:
modulo51
modulo51
Rating (110): A-
Questions Asked: 1
Tutorials Posted: 353, earned $2,117.64
 

$5.00 Java: Dice 36,000 rolls, Random class, tabulated results, NetBeans project, UseNotes, consoleOuputt

  • This tutorial hasn't been purchased yet.
  • Posted on Jul 30, 2009 at 11:52:48PM
A:
Preview: ... tic int[] values = new int[11];<br><br> static void runSimulation() {<br><br> Random die = new Random();<br><br> int sum = 0;<br> for (int roll = 1; roll <= 36000; roll++) { // added =<br><br> sum = die.nextInt(6) + 1 + die.nextInt(6) + 1;<br> values[sum - 2]++;<br> }<br><br> }<br><br> // add up the array values to check the arithmetic:<br> static void qualityCheck() {<br> int sum = 0;<br> for (i ...

The full tutorial is about 690 words long plus attachments.

Attachments:
Dice.java (1K) (Preview)
DiceConsoleOutput.txt.txt (0K) (Preview)
DiceTutorNotes.txt (3K) (Preview)
DiceZipped.zip (22K)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty