import [login to view URL]; import java.io.*;
/**************************************************************************** * CampPosanivee * The program will keep track of who is enrolled for the two-week summer * camp. The program uses a binary search tree to maintain the set of campers * enrolled in Camp Posanivee. The program is not case sensitive and read a * text file to process commands. The commands include: H (help), E (enroll * new camper), W (withdraw a camper), D (display the age and gender of a * camper), A (display avg age of campers), L (list all campers), S (print the * number of boy and girl campers), P (display all campers names in preorder), * Q (quit). * * @author Name * @version 1.0 * @date Date *
*****************************************************************************/ public class Posanivee { static String name; static String age; static String gender; static Camper camper = null;
/************************************************************************* * main The main method is the controlling method for Camp Posanivee. * Preconditions: must have properly formatted data file. * Postconditions: be able to create a Queue and BST for data. * @param args * @throws IOException
************************************************************************/ public static void main(String[] args) throws IOException { [login to view URL]("Welcome to Camp Posanivee!!\n"); Scanner user = new Scanner( [login to view URL] ); String inputFileName; //[login to view URL]("Input File Name: "); //inputFileName = [login to view URL]().trim(); ArrayList CustQ = new ArrayList(); ArrayList WaitTime = new ArrayList(); //double totmins = 0; try { BufferedReader in = new BufferedReader(new FileReader(new File("[login to view URL]"))); for (String x = [login to view URL](); x != null; x = [login to view URL]()) { Camper[] a = {1,5,2,7,4}; BST bst = new BST(); //for(Camper n : a) [login to view URL](n); }
/****************************************************************************
* Camper class The camper class is intended to create a comparable class of * campers. The data structure includes name, age, and gender and the * information is stored in a binary search tree using a queue. * * @author Name * @version 1.0 * @date Date * @course * @instructor
*****************************************************************************
/ public class Camper implements Comparable { Camper doug = 26; BST(Camper Doug); }
/****************************************************************************
* Binary Search Tree class * * @author Provided by Instructor * @version 1.0 * @date Date
*****************************************************************************/
public class BST { private class treenode { Comparable item; treenode left, right; } treenode root; // ref to the root of the bst int count; private Queue Q; // create for info public static final int PREORDER = 0; public static final int INORDER = 1; public static final int POSTORDER = 2; public BST() { // create an empty BST object root = null; count = 0; Q = new QueueLL(); // create new LL for objects } public void makeEmpty() { root = null; count = 0; z [login to view URL](); } public boolean isEmpty() {
===================
Deliverable will be - The program I started with modifications to make it function.
PFA the sample output.