Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program is in C++ Background: Craps is a dice game in which the players make wagers on the outcome of the roll, or a

This program is in C++

Background:

Craps is a dice game in which the players make wagers on the outcome of the roll, or a series of rolls, of a pair of dice. Players may wager money against each other (playing "street craps", also known as "shooting dice" or "rolling dice") or a bank (playing "casino craps", also known as "table craps", or often just "craps"). Because it requires little equipment, "street craps" can be played in informal settings.To start a round, the shooter makes a "come out" roll. A come out roll of 2, 3 or 12 is called "craps" and is an immediate loss. A come out roll of 7 or 11 is a "natural", and is an immediate win. The other possible rolls are called the point numbers: 4, 5, 6, 8, 9, and 10. If the shooter rolls one of these numbers on the come out roll, this establishes the "point", and the point number must be rolled again before a seven on subsequent rolls in order to win.

Assignment: You will create this game that you did in hw03b and hw04b, but this time using objects.. Give the user 5 chips initially. Subtract 1 for a loss and add one for a win. Stop when theuser is out of chips or has 10 chips. Output the number of chips at the end of each game. Your program must do the following:

* You must create a dev c++ PROJECT for everything to run correctly. The project willcontain the 3 files below

* Create and save a header file named Craps.h with private data members and public functions prototypes

* Create a .cpp file named Game.cpp to keep the function definitions.

* Create the main program named hw07.cpp as the main program to declare objects and call functions.

* The number of functions you decide to use may vary, but you should have functions for making a roll, getting the total, incrementing/decrementing chips, and functions for displaying the needed variables.

*Declare at least these private variables: int roll1, roll2, total, point, chips; int maxChips, minChips;

Sample Output:

Press enter to play:

You rolled a 2 and a 6

you rolled the point. roll again

You rolled a 3 and a 6

Push on roll again

You rolled a 6 and a 2

You won

CHIPS: 6

Press enter to play:

You rolled a 4 and a 4

you rolled the point. roll again

You rolled a 2 and a 3

Push on roll again

You rolled a 6 and a 2

You won

CHIPS: 7

Press enter to play:

You rolled a 3 and a 2

you rolled the point. roll again

You rolled a 2 and a 3

You won

CHIPS: 8

Press enter to play:

You rolled a 3 and a 4

you won

CHIPS: 9

Press enter to play:

You rolled a 5

and a 2

you won

CHIPS: 10

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_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

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

Prepare a short profile of Lucy Clifford ?

Answered: 1 week ago

Question

Prepare a short profile of Rosa parks?

Answered: 1 week ago

Question

Prepare a short profile of victor marie hugo ?

Answered: 1 week ago