Concepts tested by this program:

  • Create a binary search tree
  • Create generic classes from interfaces
  • Use binary files – read/write
  • JTable – selecting a row

Your assignment is to write a program that maintains a list of courses for a college. The program must be able to search for, make insertions, deletions and edit of courses. The program must be able to edit characteristics for any course. The program will also print out a course catalog.

Input

  • Text File - Use the FileChooser for the user to select the file. Each course’s information is on six consecutive lines. The format of each line is described in the table below:
Line Information
1 Course Name (CS204)
2 Instructor (Myers)
3 Description (Computer Science II)
4 Credits (4)
5 Days (MW)
6 Time (12:00 – 1:40 pm)
  • Binary File - Use the FileChooser for the user to select the file. See image.

After Read Text or Binary File – Print Catalog and Insert Course become available See image.

When selecting a row in the table – Display the Course details and the Delete and Edit Course buttons become available See image.

Output

  • Output in binary format when the program is exited. Output in preorder format. Use the FileChooser for the user to select the file to be stored in.

Data Element

  • Create a Course class that implements the DataElementInterface which extends the Comparable and Keyable interfaces. The course name will be the key (i.e. CS226).

Data Structures

  • Create a binary search tree class BST which implements the BSTInterface. It will be a generic class that can be used with any objects which implement the DataElementInterface. Implement Serializable to allow for reading from and writing to an object stream.

Data Manager

  • Create a Courses class that maintains a collection of Course objects with a binary search tree. Implement the DataManagerInterface. The course name will be the key for the binary search tree. Implement Tableizeable which takes the fields of all the objects in the binary search tree and puts them into a two dimensional array of strings to populate a table. Implement Serializable to allow for reading from and writing to an object stream.

Exception Handling

  • Deleting or Editing a Course that is not in the binary search tree.
  • Adding a course with the same key as one that exists in the binary search tree

GUI

  • Insert a Course Prompt the user for the Course name, Instructor, Description, credits, days and time. Add to the collection of course objects. If any of the information is missing, print a message.
  • Delete a Course The course in the selected row of the table is deleted. The table no longer displays this course. If the user has not put in the Course name or selected a row, print the following message: See image. See image.
  • Edit a Course The course in the selected row of the table is available to be edited. The table will show the edited version of the course. The user may edit the fields. If the user has not selected a row, print the following message: See image.
  • Select a row in the table Display all the details of the course of the selected row in the table.
  • Print a Catalog Print out the courses in order based on the Course Name. Output to a file in text format. Use the FileChooser for the user to select the file to be stored in. See image.
  • Exit Output in binary format when the program is exited. Use the FileChooser for the user to select the file.
Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.