Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Student ID at Qatar University is composed of year of admission and students number. In this project, we aim to implement a structure that
Student ID at Qatar University is composed of year of admission and students number. In this project, we aim to implement a structure that improves operations of inserting and searching for a student. To enhance these operations when using tree data structure, we will use hash table that contains trees (treeTable) where each tree holds only data of students admitted in a specific year. Figure I illustrates this concept: 6 We will keep data for 20 years so the table length is 20, and your hash function will be h(year)= year% 20. Using linear probing implement the following functionalities in treeTable: Implementation: 1- Each node in the tree will hold an object of type Student. 2- Student class has: id (int), name(String), address(String), GPA (double). 3- You should have one class that implements the structure above, call it tree Table which has the following methods: a) void insert(Student). This method inserts students in the appropriate tree based on his id. b) Student find (int). It receives an id, and returns student record with that id, or it returns null if it was not found. c) boolean remove(int). It receives student' id, removes his record if found and returns true, or returns false if it was not found. d) printStudent (int): it receives an integer number represents the year, then prints students' data who were admitted in that year using inoder approach. e) printAll(): this method prints all students in the tree Table using preorder to print the students in each tree. f) student WithGPA(double): it returns array list of all students whose GPA is below the received parameter. 4- Your main application should have a menu with the following functionalities: a) Add new student: which prompts user to enter student's data, then insert it to the treeTable. b) Search for a student: which prompts user to enter an id then search in treeTable and display the result. c) Delete a student: which prompts user to enter a student id, then remove his record, or display a message indicating this student was not found. d) Display students' data: which prompts user to enter a year, then display students' data of that year. e) Display students with less GPA: it prompts user to enter a number, then display students' data whose GPA is less than the input value. f) Save to file: which saves tree Table to a file. g) Load data: which loads data from a file to treeTable. 5- Using GUI in your program will allow you for 10% bonus.
Step by Step Solution
★★★★★
3.26 Rating (152 Votes )
There are 3 Steps involved in it
Step: 1
Mainjava import javaioIOException import javautilScanner public class Main public static void mainStringargs throws IOException treeTable theTree new treeTable theTreeinsertnew Student201800003 Ali Mo...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started