Question: solve this in c++ with complete detail and comments. Two dices are thrown 500,000 times in a game played by three players, but after throwing

 solve this in c++ with complete detail and comments. Two dices

solve this in c++ with complete detail and comments.

Two dices are thrown 500,000 times in a game played by three players, but after throwing dice 165,000 times another player joins in, and overall players become four. Each player is an object and you need to find out how many times a player got a certain value (after throwing pair of dice each time). Overall points will be calculated in the following manner: The player who scored 8 (sum of dice 1 and dice 2) for 30 times wins 10 points, second one to score 8 for 30 times wins 9 points and other two gets 0. The player who scored 10 (sum of dice 1 and dice 2) for 20 times wins 8 points, second one to score 10 for 20 times wins 5 points and other two gets 0. For every doubles (e.g. 1 and 1, 2 and 2, 3 and 3 and so on) player pets 1 point A player can take another turn if he scores 12 (6+6) and gets 10 additional points. Maintain a counter of additional turns for all the players as well, Whoever has the maximum sum of points, wins the game, report which player wan after 500,000 times dice roll. Use random numbers to generate values of two dice. (15 Marks) Page 2 of 2

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!