@@ -0,0 +1,1768 @@
+public class Test1 %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09System.out.println(%22Instructions:%22);%0A%09%09System.out.println(%22Press 'enter' after typing something.%22);%0A%09%09System.out.println(%22Type a string (up to 3 non-whitespace characters long).%22);%0A%09%09System.out.println(%22Type a '+' sign to start inserting.%22);%0A%09%09System.out.println(%22Type a '-' sign to start deleting.%22);%0A%09%09System.out.println(%22Type a '/' sign to toggle modes.%22);%0A%09%09System.out.println(%22Type a '*' sign to end the program.%22);%09%09%0A%09%09System.out.println(%22For best results, please have the console use the full screen.%22);%0A%09%09StringAVLTreeExtra t = new StringAVLTreeExtra();%09%0A%09%09Scanner input = new Scanner(System.in);%0A%09%09String s = new String();%0A%09%09boolean amInserting = true; //false if deleting%0A%09%09String%5B%5D msg = %7B%22Entered insertion mode.%22,%22Entered deletion mode.%22%7D;%0A%09%09do %7B%0A%09%09%09s = input.next();%0A%09%09%09if (s.equals(%22+%22)) %7B// enable insertion%0A%09%09%09%09amInserting = true;%0A%09%09%09%09System.out.println(msg%5B0%5D);%0A%09%09%09%7D%0A%09%09%09else if (s.equals(%22-%22)) %7B// enable deletion%0A%09%09%09%09amInserting = false;%0A%09%09%09%09System.out.println(msg%5B1%5D);%0A%09%09%09%7D%0A%09%09%09else if (s.equals(%22/%22)) %7B//toggle Modes%0A%09%09%09%09amInserting = !amInserting;%0A%09%09%09%09int n = amInserting?0:1;%0A%09%09%09%09System.out.println(msg%5Bn%5D);%0A%09%09%09%7D%0A%09%09%09else %7B%0A%09%09%09%09if (amInserting) %7B%0A%09%09%09%09%09t.insert(s);%0A%09%09%09%09%7D%0A%09%09%09%09else %7B %0A%09%09%09%09%09t.delete(s);%0A%09%09%09%09%7D%0A%09%09%09%09%0A%09%09%09%09if (!t.isEmpty())%0A%09%09%09%09%09System.out.println(t);%0A%09%09%09%09%09System.out.println(%22balanced() returns:  %22 + t.balanced());%0A%09%09%09%09%09System.out.println(%22height()   returns:  %22 + t.height());%0A%09%09%09%09%09System.out.println(%22leafCt()   returns:  %22 + t.leafCt());%0A%0A%09%09%09%09%09//uncomment for testing successor.%0A%09%09%09%09%09System.out.print(%22Find successor of: %22);%0A%09%09%09%09%09String a = input.next();%0A%09%09%09%09%09System.out.println(%22successor(%22+a+%22) returns: %22 + t.successor(a));%0A%09%09%09%09%7D%0A%09%09%7D while (!s.equals(%22*%22));%0A%09%7D%0A%7D%0A

Create Test1.java