Question
Create a simple guessing game in C++ that the user can play against the computer. Start by creating an enumerated type to represent fruits (have
Create a simple guessing game in C++ that the user can play against the computer. Start by creating an enumerated type to represent fruits (have at least 10 fruits of your choice listed). Generate a random number between 0 and 9 this number will be used to access a random fruit from the list. This will be the computer choice. The program will ask the user to guess the name of the fruit the computer has picked. The user then enters a guess. If the user is right he/she wins. Otherwise the computer wins. The user can play as many times as he/she wants. Once the user decides to quit the game, display the number of times the computer won and the number of times the player won. Write at least two functions: One to handle the input of a fruit as an enumerated type; and one to handle the display of a fruit name.
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