This is an extension of the animal-guessing game. Call your file that contains the main method AnimalGuess.
Do not write the data as an object. Create a file structure where you use primitive data types and strings. You will chose a format for the records. The easiest is probably to write lines terminated by a new line (using PrintWriter's println method) and then read lines with BuffereredReader's readLine method.
You also need to decide how to traverse the tree when writing it out to disk. Pick a method that makes it possible to read the file back in and rebuild the tree.
In the documentation for your code tell me what **traversal method** you are using and give a **description of the records** you are writing. Don't just print the records. If you use special symbols in the record, tell what they indicate.
Only submit the classes where you have made a change. (That is, if you make no change to EasyReader, don't include it with your submission). In the comments at the start of the class, put your name, the date modified, and a brief description of the change made.
You will probably want to use recursion in this project.
You can download the code from the book at:
[login to view URL]~main/[login to view URL]
I took out the package statements in BTNode and EasyReader, removed the imports in AnimalGuess, put all three file in the same folder, and compiled.
## Deliverables
Here is the problem statement for those of you without a book:
Revise the animal-guessing program from Figure 9.8 on page 463 so that the initial knowledge tree is obtained by reading information from a file. Also, when the program ends, the knowledge tree at that point is written to the same file. You must carefully specify the format of the data in this file. The format should make it easy to do two things: (a) read the file and set the initial tree and (b) write the knowledge tree to the file using some kind of traversal.
BE SURE TO SUBMIT YOUR OUTPUT. I can not give you full credit without the output!
Use a object-oriented solution.
## Platform
java