Question: Use the material from Section 10.3 to reimplement the animal-guessing program from Figure 9.8 as a JApplet. Youll need to research additional details of the
Use the material from Section 10.3 to reimplement the animal-guessing program from Figure 9.8 as a JApplet. You’ll need to research additional details of the Java classes.
![FIGURE 9.8 The Animal-Guessing Program Java Application Program // FILE: Animal.java // This animal-guessing program illustrates the use of the binary tree node class. import edu.colorado.nodes.BTNode; // For BTNode import java.util.Scanner; public class Animal { private static Scanner stdin = new Scanner(System.in); public static void main(String[ ] args) { BTNode](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1605/8/5/4/0525fb763640c1d91605854050483.jpg)

FIGURE 9.8 The Animal-Guessing Program Java Application Program // FILE: Animal.java // This animal-guessing program illustrates the use of the binary tree node class. import edu.colorado.nodes.BTNode; // For BTNode import java.util.Scanner; public class Animal { private static Scanner stdin = new Scanner(System.in); public static void main(String[ ] args) { BTNode root; instruct( ); root = beginningTree( ); do play(root); while (query("Shall we play again?")); System.out.println("Thanks for teaching me a thing or two."); } public static void instruct( ) I| The implementati on of this method is omitted write it yourself! public static void learn(BTNode current) || The implementation of this method is Self-Test Exercise 9. public static void play (BTNode current) { while (!current.isLeaf( )) { if (query(current.getData( ))) current = current.getleft(); else current = current.getRight( ); "); System.out.print("My guess is " + current.getData( ) + if (!query("Am I right?")) learn(current); else System.out.println("I knew it all along!"); }
Step by Step Solution
3.46 Rating (166 Votes )
There are 3 Steps involved in it
import javaxswing import javaawt import javaawtevent public class AnimalGuessing extends JApplet implements ActionListener private static final long s... View full answer
Get step-by-step solutions from verified subject matter experts
