Design and implement an application that simulates a simple slot machine in which three numbers 0 and 9 are randomly selected and printed side by side. Print an appropriate statement if all three of th numbers are the same, or if an two of the numbers are the same.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 14E
icon
Related questions
icon
Concept explainers
Question
100%

Use C++

Design and implement an application that simulates a simple slot
machine in which three numbers 0 and 9 are randomly selected and
printed side by side. Print an appropriate statement if all three of the
numbers are the same, or if an two of the numbers are the same.
Continue playing until the user chooses to stop. (use while loop)
Transcribed Image Text:Design and implement an application that simulates a simple slot machine in which three numbers 0 and 9 are randomly selected and printed side by side. Print an appropriate statement if all three of the numbers are the same, or if an two of the numbers are the same. Continue playing until the user chooses to stop. (use while loop)
3 5 8
No match
Play again (y/n)?: y
1 7
4
No match
Play again (y/n)?: y
3 1 3
Matched 2!!
Play again (y/n)?: y
5 3 3
Matched 2!!
Play again (y/n)?: y
18 9
No match
Play again (y/n)?: n
7
Matched 2!!
Play again (y/n)?: y
5 0
6
No match
Play again (y/n)?: y
3 3 3
Jackpot!!!
Play again (y/n)?: y
9 1 8
No match
Play again (y/n)?: y
95 9
Matched 2!!
Play again (y/n)?: n
No match
Play again (y/n)?: y
99 1
Matched 2!!
Play again (y/n)?: y
056
No match
Play again (y/n)?: y
70 7
Matched 2!!
Play again (y/n)?: n
Transcribed Image Text:3 5 8 No match Play again (y/n)?: y 1 7 4 No match Play again (y/n)?: y 3 1 3 Matched 2!! Play again (y/n)?: y 5 3 3 Matched 2!! Play again (y/n)?: y 18 9 No match Play again (y/n)?: n 7 Matched 2!! Play again (y/n)?: y 5 0 6 No match Play again (y/n)?: y 3 3 3 Jackpot!!! Play again (y/n)?: y 9 1 8 No match Play again (y/n)?: y 95 9 Matched 2!! Play again (y/n)?: n No match Play again (y/n)?: y 99 1 Matched 2!! Play again (y/n)?: y 056 No match Play again (y/n)?: y 70 7 Matched 2!! Play again (y/n)?: n
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage