Question: model a simple dice game in c using a drand48 generator. game with two dice, a red one and a blue one. six dots on

model a simple dice game in c using a drand48 generator.

game with two dice, a red one and a blue one. six dots on their sides.

you throw the two dice. It will cost you $1.00 for each throw of two dice. (initial value)

If the number of dots on the red dice is greater than the number of dots on the blue dice, you win $2.25.

So you have to pay $1.00 each time you play but you can win $2.25 if the number of dots on the red dice is greater than the number on the blue dice.

Program/game needs to model the game to show if you will win money or lose money with the system. Using drand48() excute the results for 100 throws of the two dice.

Step by Step Solution

3.44 Rating (170 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solution include include include include define WON 0 define LOSE 1 int rollDice void int playGame ... View full answer

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 Mathematics Questions!