Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 2- Mushroom identification The purpose of this exercise is to write a C++ program that asks questions to the user in order to guess
Exercise 2- Mushroom identification The purpose of this exercise is to write a C++ program that asks questions to the user in order to guess which mushroom the user has in mind among a list known in advance) In order to guess the user's mushroom, the program can ask at most 3 questions that only have yeso answers (the user will reply to the questions of the program with O forno, and I for yes). The 6 possible mushrooms are: - the "yellow agaric": the "fly agaric": the "porcini mushroom": the "hairy coprin"; . the "cantharellus cibarius"; the "wood blewit", 1. The "porcini mushroom" is the only one to have pores, the other mushrooms having gills. 2. Both "hairy coprin" and "yellow agaric" grow in meadows, while all the other mushrooms grow in the woods. 3. The only mushrooms to have a convex cap are the "yellow agaric", the "fly agaric" and the "wood blewit". 4. And the only mushrooms to have ring are the "yellow agaric", the "fly agaric" and the "porcini mushroom" You are requested to write the whole C++ program so that it can find, using at most 3 questions, the mushroom the user is asking for
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