Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem: In this lab, you will be using Visual Studio to implement the classic game of Craps. Craps is a game of numbers and dice.

Problem: In this lab, you will be using Visual Studio to implement the classic game of Craps. Craps is a game of numbers and dice. The challenge is that when the user rolls the dice there are two sets of rules to follow depending on whether the roll is the users first roll to set the point/goal or it is one of potentially many rolls after the point/goal has been set. The rules are detailed below. PART A The rules for the Craps game are below. The Rules THERE ARE A FEW DIFFERENT VARIATIONS OF CRAPS. IN THIS VERSION, THE PLAYER ROLLS TWO DICE, AND THE SPOTS ON THE DICE ARE ADDED TOGETHER. THE PLAYER WINS ON THE FIRST ROLL IF THE DICE SHOW A TOTAL OF 7 OR 11. THE PLAYER LOSES IF THE TOTAL IS 2, 3, OR 12. IF ANOTHER NUMBER IS THROWN ON THE FIRST ROLL FOR EXAMPLE, A 10 THAT NUMBER BECOMES THE POINT, OR THE GOAL OF SUBSEQUENT TOSSES. THE PLAYER CONTINUES TO ROLL THE DICE UNTIL THE POINT OR A 7 APPEARS. THROWING A TOTAL EQUAL TO THE POINT MEANS THE PLAYER WINS AND THROWING A 7 MEANS THE PLAYER LOSES. THIS IS THE VERSION OF CRAPS USUALLY PLAYED IN CASINOS. SOME EXAMPLES: FIRST TOSS: 3 IMMEDIATE LOSS FIRST TOSS: 11 IMMEDIATE WIN FIRST TOSS: 10 SECOND TOSS: 9 THIRD TOSS: 4 FOURTH TOSS: 10 WIN FIRST TOSS: 10 SECOND TOSS: 9 THIRD TOSS: 7 LOSS

In this program, you will need to use the Random class to randomly generate 2 numbers to determine what the user rolled on each die (2 dice total). When the player clicks on the 'Roll the dice' button the computer will randomly select two numbers. Using these randomly select numbers, it will display two dice representing the correct numbers that were chosen. It will also display the numbers for each die and the total. After rolling the dice, the game status will be displayed by the placement of the puck. A black puck indicates the game is in the come out roll (set roll) state. A white puck indicates a subsequent roll and the point value (or goal). A message indicating a win, loss, or other relevant information should also be displayed. This game should keep score, if a player wins, one should be added to the score and if the player loses, one should be subtracted from the score. The score can be negative. Use switch statements.

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

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

a. How will the leader be selected?

Answered: 1 week ago