Question
C++ Game : Roll the dice 10 times for a chance to win 2x your bet. If 7 or 11 appears 3 times you win
C++
Game: Roll the dice 10 times for a chance to win 2x your bet. If "7 or 11" appears 3 times you win 2x your bet otherwise you lose your bet. If "snake-eyes" appears twice you automatically lose your bet.
1. Allow the user to place a wager (in dollars, no cents). 2. Declare a 10 element integer array called rolls. 3. Populate each element of rolls with the sum of two dice (automate this process for the user). 4. Show the user the results. --- --- --- 5. Run a linear search (term by term) of the array rolls and count the number of times "snake-eyes" was rolled. Show the user the results. 6. Run a linear search (term by term) of the array rolls and count the number of times "7 or 11" was rolled. Show the user the results. --- --- --- 7. Determine if the user has won or lost the round. Display "You won!" or "You lost!". 8. Accumulate a score (display it) and ask the user if he wishes to play again.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started