Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Step: 3

blur-text-image

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 Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

Draw the plane given by the equation. x + y + z = 4

Answered: 1 week ago