Question: Implement the animal guessing game described in Section 17.2.1. Start with the tree in Figure 4, but present the leaves as Is it a(n) X?

Implement the animal guessing game described in Section 17.2.1. Start with the tree in Figure 4, but present the leaves as “Is it a(n) X?” If it wasn’t, ask the user what the animal was, and ask for a question that is true for that animal but false for X. For example,

Is it a mammal? Y Does it have stripes? N Is it

Figure 4

a pig? N I give up. What is it? A hamster Please

Is it a mammal? Y Does it have stripes? N Is it a pig? N I give up. What is it? A hamster Please give me a question that is true for a hamster and false for a pig. Is it small and cuddly? In this way, the program learns additional facts.

Step by Step Solution

3.52 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Great Lets implement an animal guessing game in Python based on the requirements and the decision tree provided in your images Here is a simple Python ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!