Stage 6 Modify your code to now allow betting. Define and initialize variable chip_balance to 100. Prompt the player to

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Stage 6 Modify your code to now allow betting. Define and initialize variable chip_balance to 100. Prompt the player to

Post by answerhappygod »

Stage 6 Modify Your Code To Now Allow Betting Define And Initialize Variable Chip Balance To 100 Prompt The Player To 1
Stage 6 Modify Your Code To Now Allow Betting Define And Initialize Variable Chip Balance To 100 Prompt The Player To 1 (95.6 KiB) Viewed 22 times
That C language question, we will get questions as well as
output of code
just we have to write the code of these questions and get these
output above
Stage 6 Modify your code to now allow betting. Define and initialize variable chip_balance to 100. Prompt the player to enter a bet; read the bet. If the player wins, increase the chip_balance by the bet and display the new balance. If the player loses, decrease chip_balance by the bet and display the new bank balance. If the player hits the post, decrease chip_balance by the bet and display the new bank balance. Check if chip_balance has become zero, and if so, display the message "Sorry, you're all out of chips! *** Game Over ***" to the screen. Sample output 1: Die 1: 5 Die 2: 10 Number of chips: 100 Place your bet: 100 Not the same, let's play! Die 3: 9 *** You win! *** You now have 200 chips! 8 of 24
Thanks for playing! Sample output 2: Die 1: 6 Die 2: 10 Number of chips: 100 Place your bet: 10 Not the same, let's play! Die 3: 2 *** Sorry - You lose! *** You now have 90 chips! Thanks for playing! Sample output 3: Die 1: 6 Die 2: 7 Number of chips: 100 Place your bet: 100 Not the same, let's play! Die 3: 4 *** Sorry - You lose! *** You're all out of chips! *** GAME OVER *** Thanks for playing! Sample output 4: Die 1: 4 Die 2: 10 Number of chips: 100 Place your bet: 20 Not the same, let's play! Die 3: 10 *** You hit the post - You lose! *** You now have 80 chips! Thanks for playing!
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply