Question: Write a program that simulates the rolling of two dice. The program should use rand to roll the first an second dice. The sum of

 Write a program that simulates the rolling of two dice. The

Write a program that simulates the rolling of two dice. The program should use rand to roll the first an second dice. The sum of the two values should then be calculated. [Note: Since each die can show an intege value from 1 to 6, then the sum of the two values will vary from 2 to 12, with 7 being the most frequent sun and 2 and 12 the least frequent sums.]. There are 36 possible combinations of the two dice. Your progran should roll the two dice 50,000 times. Use a 2D array to tally the numbers of times each possible sum appears Print the results in a tabular format. The player wins if the total of the diagonal elements is greater than 8350 otherwise the player loses. 5 6 7 8 3 4 5 7 8 9 9 10 Diagonal elements 6 7 8 9 10 11 Sample output: (The table formatting should look like the same as in the screen shots below) rince@Raji-PC /hrc N/TSD TSD TP2 2812/week? 14221381 137414021311 1350 :1443 : 1369 : 1437 : 1399 : i493 1372 : 1382 1368 1451 1404 1381 143 11346 | 1104 | 13% 1395 1363 1395 : 1365 131713391379 13681368 he sum of the diagonal elements is 1422+ 1115 1437 1404 1363 1368 8409 8409 ie greater than 8350, the player won the gano1 137313411399 11151318 1318 1362 1441 1357 13661386 1411 :1371 | 1356 1379 1387 i428 : 1424 11397 | 13531 1432 13511 14101 14541 1419 148 13981100 140 1164 1351 I 1380 1139 1312 13191349 he aun oF the diagonal elenents is 1373 1441 1379 1351 1497 1349 8300 8300 is lose than 8358, the player lost the gane

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!