Student Database Using Binary Trees

 

This project is due in two weeks.

 

You are to create programs that keep track of students and their GPAs.  Users of your system should be able to do the following:

 

1.      Input a student (some name) and their GPA.  The name and GPA should be inserted into a sorted binary tree of students. 

2.      Push a button to get a list printed out of all the students in the school and their GPAs.  The list should be printed in alphabetical order.

3.      Push a button to print the student list in reverse alphabetical order.

4.      Find a particular student in school and print out their GPA.

5.      Remove an student from school completely.

6.      Change the GPA of a student in school.

7.      Count the total number of students in school.

8.   Calculate the average GPA for the school.

 

You are to create a class for a binary tree data structure.  You should also have a driver program that takes user input and manipulates a node object and prints output.  The driver should be written as a Java application with buttons and text input and output.

 

One way to do this is to have two text fields for input and then have buttons that say “add to school,” “print school,” etc.  Think about your design and draw it out before you write the code.  Also, draw your data structures before you write any code.  Think about what goes in your application and your class before you write any code.

 

Another suggestion.  Implement 1 and 2 before writing any code for the others.

 

Honors Option

 

Create separate databases for different departments (e.g. Math, CompSci, Bus).  The department should be selected from a drop-down list in the driver.  All the functions 1-8 should operate on whatever department is specified.  In addition, you should have buttons that calculate 7 and 8 for the entire school.  The multiple databases must be implemented in a general manner.  That is, you should have an array or list of trees, not individually named trees.  See me if you are at all uncertain about this.

 

Deliverables:

1.      source code for the tree class and driver

2.      O( ) analysis for each of your students 1-8 above

3.      test output

4.   bring your code to class