Please Help! rolling of two dice.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Please Help! rolling of two dice.

  1. #1
    Join Date
    Nov 2004
    Location
    Newark, New Jersey
    Posts
    38

    Please Help! rolling of two dice.

    I am Trying to write a program that does the following:


    Write a program that simulates the rolling of two dice. The program should use rand to roll the first dice and should use rand
    again to roll the second dice. The sum of the two values should then be calculated. [note: each dice can show an integer value from 1-6, so the sum of the two values will vary from 2-12, with 7 being the most frequent sum and 2 and 12 being the least frequent sums] Your program should roll the dice 36,000 times. use a single array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals are reasonable (i.e. there are six ways to roll a 7, so approximately one sixth of the rolls should be 7).


    Please help me.

    Thank you in advance.

  2. #2
    Join Date
    Jun 2004
    Location
    Houston area
    Posts
    557
    Is this a school project? If so, why don't you create your GUI and get started on the code and we'll help you when you get stuck.

    L
    A balanced diet is a cookie in each hand.

  3. #3
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    You might also try searching Google for "vb dice rnd" ;-)
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center