Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement a program that simulates the game of Craps. The computer will display the rolls of the game using random numbers to generate them and

  1. Implement a program that simulates the game of Craps. The computer will display the rolls of the game using random numbers to generate them and will prompt the user to play again. In addition to the die result. The computer will display an interpretation of the results for each roll. The Rules of the Game:
    1. There is an initial roll of 2 dice resulting in a sum of 2 12.
      1. If the sum is 2, 3 or 12 it is called "craps" or "crapping out" and the game is over with a loss.
      2. If the sum is 7 or 11 it is called a natural and the game is over with a win.
      3. For all other values, the sum becomes the point and the user makes subsequent rolls until they either throw a 7 in which case they loose or they make the point sum in which case they win.
    2. After a win or loss the next player rolls the die for a new game. In simulation, the program will simply ask the user if they want to continue to play.
  2. For each roll show the value for each die and the sum.
    1. For case i or ii above, indicate that the user either crapped out or won with a natural and then prompt to play again.
    2. For case iii indicate that the sum is now the point. For each subsequent roll indicate the status of the result:
      1. Trying for point
      2. Made point and won. (Prompt user to play again.)
      3. Got a seven and lost (Prompt user to play again.)
  3. EMBED A SCREEN SHOT OF NETBEANS HERE SHOWING YOUR PROGRAM RUN:

  1. While you dont have to show all of this, be sure to test your program enough to make sure that it correctly handles all the game states described above.

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions