Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

Assessment of skills and interests.

Answered: 1 week ago

Question

Psychological, financial, and career counseling.

Answered: 1 week ago