Question: Write in C++ Write a program that simulates the rolling of two dice. The program should use rand to roll the first and second dice.

Write in C++ Write a program that simulates the rolling of two dice. The program should use rand to roll the first and second dice. The sum of the two values 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 frequent sums.]. There are 36 possible combinations of the two dice. Your program 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. 3 4 5 67 9 10 Diagonal elements 5 6 7 8 9 6 7 8 9 10 11 Sample output: (The table formatting should look like the same as in the screen shots below) 1422 1381 137414213111350 11414 1415 : 1402 1395 1302 1481 ; :1443 :1369 : 143? 1399 1493 1372 1382 1368 11511401381 1437 :1346 140b4 : 1376 1395 i363 i395 : :1365 13171 1339 ; 1379 1368 1368 ho sun oF the diagonal alonento ia 1422 1415 1437 1404 1363 1368 8499 is greater than 8350, the player von the gane !! :1373 : 1344 : 1399 1415 134B 1318 11362 : 1411 1357# 1366 1396 1411 1371 13561379 1387 11281121 1397 135314321351 1410 1454 :1449 : 1487 : i398 : i 00 407: i 64 : :1354 : 138: i439 i342 i3491 1349 : he sun ef the dingenal elenents is 1373 1441 13'79 1351 107 1349 8300 io loee than 8358, tho player loet tho gano
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
