Dice Rolling

Write a program that simulates the rolling of two dice. The program should use rand to roll the first die and should use rand again to roll the second die. The sum of the two value should then be calculated. [Note: Since each die can show an integer value from 1 to 6, then the sum of the two values will vary from 2 to 12 with 7 being the most frequent sum and 2 and 12 the least frequents sums.] There are 36 possible combinations of the two dice. Use an array to tally the numbers of times each possible sum appears. Print the result in tabular format.

micheal Amirul
0
Newbie Poster

## Recommended Answers

Jump to PostUmm ... We're not going to just do your homework assignment for you. Try the assignment yourself, and post in the appropriate language forum (C++, Java, etc) along with what you've tried so far and exactly where you're stuck.

## All 4 Replies

Dani
2,446
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member

micheal Amirul
0
Newbie Poster

micheal Amirul
0
Newbie Poster

WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.