implementing a simple binary search tree capable of storing  and retrieving student information.  The class should have private member variables (each separated by a tab): student's id number - an integer student's name - a string student's declared major The class should have private member functions as a minimum: openFile - opens the input file testFile - tests the input file has been opened properly readFile - reads in one student's information closeFile - close the input file insert - inserts the students information into the proper place in the tree structure search - search for the student id entered by the user inorder - traverses the tree structure prompt - prompts the user for a student id number validate - validate the user input value display - display the contents of the binary tree results - student id found or not found result The class should have public member functions class constructor (if needed) driver - order of execution The input file layout: student id number     student name     student declared major Read the input file students.txt from the current directory until eof storing the student information in ascending order by student id number. When the end of file is reached, traverse the binary tree displaying its contents.  The output list should be in ascending order by student id number. Prompt the user for a student id number.   Validate this value. If the value is found in the tree structure, let the user know and display the student's information.  If the value is not found in the tree structure, let the user know this as well. Continue to prompt for student id numbers until the user wishes to stop.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 16PE: The implementation of a queue in an array, as given in this chapter, uses the variable count to...
icon
Related questions
Question

 implementing a simple binary search tree capable of storing  and retrieving student information. 

The class should have private member variables (each separated by a tab):

  • student's id number - an integer
  • student's name - a string
  • student's declared major

The class should have private member functions as a minimum:

  • openFile - opens the input file
  • testFile - tests the input file has been opened properly
  • readFile - reads in one student's information
  • closeFile - close the input file
  • insert - inserts the students information into the proper place in the tree structure
  • search - search for the student id entered by the user
  • inorder - traverses the tree structure
  • prompt - prompts the user for a student id number
  • validate - validate the user input value
  • display - display the contents of the binary tree
  • results - student id found or not found result

The class should have public member functions

  • class constructor (if needed)
  • driver - order of execution
The input file layout:

student id number  <tab>   student name   <tab>  student declared major

Read the input file students.txt from the current directory until eof storing the student information in ascending order by student id number.

When the end of file is reached, traverse the binary tree displaying its contents.  The output list should be in ascending order by student id number.

Prompt the user for a student id number.   Validate this value.


If the value is found in the tree structure, let the user know and display the student's information.  If the value is not found in the tree structure, let the user know this as well.
Continue to prompt for student id numbers until the user wishes to stop.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Types of trees
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning