Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 2 Create a function to folla dice and utilize it to develop a game of chance as described below: A player rolls two dice.

image text in transcribed
Exercise 2 Create a function to folla dice and utilize it to develop a game of chance as described below: A player rolls two dice. Each dia has six faces. These facas contain 1, 2, 3, 4, 5 and 6 spots. After the dice have come to rest, the sum of the spots on the two upward faces in calculated. If the sum is 7 or 11 on the first throw, the player wins. If the sum is 2, 3 or 12 on the first throw (called "craps"), the player loses 6.e.. the house wind). If the sum is 4,5,6,8,9 or 10 on the first throw, then that num becomes the player's "point." To win, you must continue rolling the dice until you make your points same current point). The player lose by rolling a 7 before making the point Note: utilize function random.candrange to create a function to roll a doo First part Create a function to roll a dion. This function needs to generate 2 random numbers from 1 to 6 and return the sum of numbers. You can utilize function randomrandrange to create a function to roll a dice In 141: Fereate the function here Second part Call the function created above. Use conditional statements to do the following if the sum is 7 or 11 on the first throw, the player wins. If the sum is 2.3 or 12 on the test throw (edcraps, the player to the house wins. If the sum is 4,5,6,8,9 or 10 on the first throw, then that sum becomes the player's "point if the player neither ones or wins on the first throw, you need to use loop to continue the game. To win, you must continue rolling the dice until you ce your points same current point. The player one by rolling a 7 before making the point, In the

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Step: 3

blur-text-image

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

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

what is a peer Group? Importance?

Answered: 1 week ago

Question

1. What are the major sources of stress in your life?

Answered: 1 week ago

Question

What tools might be helpful?

Answered: 1 week ago