Question: Continue Exercise E17.4 and write the tree to a file when the program exits. Load the file when the program starts again. Data from

Continue Exercise •• E17.4 and write the tree to a file when the program exits. Load the file when the program starts again.

Data from exercise E17.4

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

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.44 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Based on the description and the data given you are asked to extend an animal guessing game by adding the capability to save the current state of the games decision tree to a file when the program exi... 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!