Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. The game of Craps is a dice game that involves rolling a pair of dice. At the start of each turn if the players
1. The game of Craps is a dice game that involves rolling a pair of dice. At the start of each turn if the players rolls a 7, or 11 they win. 2. Write a program that simulates how often a player would win if they rolled the dice 100 times. 3. The program will output a message such as "The player rolled 14 sevens and 5 elevens for a total of 19 wins out of 100." 4. The program will ask the user if they wish to run another simulation or quit. 5. Possible Program structure 1. Create a random number for each dice using either the API Random class or the Math classes' random method. 2. Create a loop that will loop 100 times. 3. Within the loop 1. Store the random number output 2. if it is a seven or eleven increment the value of the appropriate variable. 4. Print out the message stating the number of sevens and elevens. 5. Use the appropriate to type of loop to prompt the user if they like to try again or quit
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started