Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Modify the craps program of Fig. 11 to allow wagering. Package as a function the portion of the program that runs one game of

C++

image text in transcribed

Modify the craps program of Fig. 11 to allow wagering. Package as a function the portion of the program that runs one game of craps. Initialize variable bank Balance to 1000 dollars. Prompt the player to enter a wager. Use awhile loop to check that wager is less than or equal to bank Balance and, if not, prompt the user to reenter wager until a valid wager is entered. After a correct wager is entered, run one game of craps. If the player wins, increase bank Balance by wager and print the new bank Balance. If the player loses, decrease bank Balance by wager and print the new bank Balance, check on whether bank Balance has become zero and, if so, print the message "Sorry. You busted!" As the game progresses, print various messages to create some "chatter" such as "Oh, you're going for broke, huh?" "Aw cmon, take a chance!" or "You're up big. Now's the time to cash in your chips

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

What is DDL?

Answered: 1 week ago