Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

Solution include include include include define WON 0 define LOSE 1 int rollDice void int playGame ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Statistics

Authors: James T. McClave, Terry T Sincich

12th Edition

9780321831088, 321755936, 032183108X, 978-0321755933

More Books

Students also viewed these Mathematics questions

Question

Can the need for discipline be reduced? If so, how?

Answered: 1 week ago