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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education