Page 1 of 1

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

Posted: Thu May 05, 2022 1:01 pm
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 24 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!