Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE WRITE THE PROJECT FULL CODE IN JAVA asked the same question before but did not get answer MUST MAKE A SCREENSHOT TO SHOW THAT
PLEASE WRITE THE PROJECT FULL CODE IN JAVA
asked the same question before but did not get answer
MUST MAKE A SCREENSHOT TO SHOW THAT PROJECT IS WORKING
The Problem Suppose you decided to create a very basic Database Management System for KAU (KAUdbms). Your KAUdatabase system should be able to store unlimited number of student records, along with their basic personal information (ID, first name, last name, age, level/year, etc.). Additionally, cachstudent record should also have a list of the courses they have taken and the grades they received in those courses. Additionally, your KAUdbms should also keep track of the total courses for the university and how many times this course has been taken by a student. Your system should also keep the average grade for each course, for all time. Implementation All students will be stored in a BINARY SEARCH TREE based off of their student ID number, andit will be guaranteed that this ordering of students (by ID) will be the exact same as the alphabetical ordering by last name and then first name. So Bob Smith is guaranteed to have a "smaller" ID than Joe Smith, because his first name is "smaller" than Joe. What is the benefit of this? This means that you do not need to insert into the BST by names. Instead, you canjust insert by ID, which is guaranteed to be also in order by name. Each student record will also have a reference to a linked list, which will have all the courses taken by that student and the grades the student received. Finally, in addition to this BST of student records, your program should also have one linkedlist of course records, which will allow you to keep a record of how many times a course was taken and the average grade for all students who took that course. Input/Output Specifications First, you need to make an input file called "KAUdbms, in" that contains the following 49 SEARCHID 1112354 SEARCHNAME Zeinab Eid ADDCOURSE 1112354 CPCS222 98 DELETE Imtiaz Khan PRINTRECORD Jonathan Cazalas PRINTALLRECORDS NEWSTUDENT 1117777 Jonathan Cazalas jcazalas(a)kau.edu.sa 350508881511 NEWSTUDENT 1112354 Ali AlGhamdi aghamdi2354@akau.edu.sa 190561158411 PRINTRECORD Jonathan Cazalas ADDCOURSE 1117777 CPCS204 10 ADDCOURSE 1117777 CPCS222 98 ADDCOURSE 1117777 CPCS223 99 ADDCOURSE 1117777 CPCS324 100 PRINTRECORD Jonathan Cazalas ADDCOURSE 1117777 CPCS204 100 PRINTRECORD Jonathan Cazalas PRINTRECORD Ali AlGhamdi ADDCOURSE 1112354 CPCS204 87 ADDCOURSE 1112354 CPCS222 92 ADDCOURSE 1112354 CPCS223 72 ADDCOURSE 1112354 CPCS324 76 PRINTALLCOURSES PRINTALLRECORDS NEWSTUDENT1418325 Bilal Zahrani bzahrani8325@stu.kau.edu.sa 200521584184 NEWSTUDENT 1113289 Muhammad Ashihiri mashihiri3289@stu.kau.edu.sa 18 0598461312 ADDCOURSE 1418325 CPCS204 65 ADDCOURSE 1418325 CPCS222 97 ADDCOURSE 1418325 CPCS223 88 ADDCOURSE 1418325 CPCS403 79 ADDCOURSE 1113289 CPCS202 72 ADDCOURSE 1113289 CPCS203 78 ADDCOURSE 1113289 CPCS222 86 PRINTRECORD Bilal Zahrani PRINTRECORD Muhammad Ashihiri PRINTALLRECORDS ADDCOURSE 1113289 CPCS111 90 ADDCOURSE 1113289 CPCS11290 ADDCOURSE 1113289 CPCS11390 ADDCOURSE 1113289 CPCS114 90 ADDCOURSE 1113289 CPCS11590 ADDCOURSE 1113289 CPCS116 90 PRINTRECORD Muhammad Ashihiri ADDCOURSE 1113289 CPCS117 90 PRINTRECORD Muhammad Ashihiri DELETE Ali AlGhamdi PRINTALLRECORDS DELETE Jonathan Cazalas PRINTALLCOURSES PRINTALLRECORDS The program must read the commands automatically from the input file The first line of the file will be an integer, 49 , indicating the number of commands that will be run on the database. The following lines will each be a single command, with the relevant data on the same line, separated by spaces. The commands you will have to implement are as follows: 1. NEWSTUDENT - A new student record is being added to KAUdbms (a new node will be added to the BST). The command will be followed by the following information: ID, a non-negative int, which you will use to sort the students by; first and last name of student; email address of the student; age, a non-negative int; phone, a non-negative int. If this student is not already in KAUdbms, they should be added to the BST. Otherwise, an error should be printed (see output). a SEARCHNAME - This command will be followed by a name, first then last. You must search the database to find this name, and then print out some information about this student. If there is not a person by that name in the database, it should print an error message saying so. See output for details. Q SEARCHID - Similar to SEARCHNAME, but based on their ID number instead. The output should be the same. If there is not a person by that ID in the database, it should print an error message saying so. See output for details. 1. ADDCOURSE - used to add courses to the student record, showing that the student has taken this course. This command will be followed by the following information: ID, a non-negative int; courseID, a String; and grade, a non-negative int. You must first search the student's list of courses to see if they already took this course. If so, this means that this is being taken a 2nd time (or 3rd or more). In this case, you should simply update the course grade in the student courses linked-list. However, if the course is not currently in the student's linked-list of courses, this means that they have not yet taken the course. Therefore, you should make a new course object, scan the data from the file, and then insert this object into the student's linked-list of courses. Note that you are keeping track of a student's level: are they a 1 year student, 2nd year student, 3nd year student, or 4th year student. For the purposes of this program, once a student has taken 10 courses ( 30 or more hours), they become a 2nd year student. Once they have taken 20 courses ( 60 or more hours), they become a 3nd year student. And once they have taken 30 courses ( 90 or more hours), they become a 4th year student. Therefore, each time a NEW course is taken, you must do something to keep track of this total, so you can know when the student becomes a 2ad year, 3nd year, etc. Also, just as in real life, if a student repeats a course, this does NOT count as a new course for them. Therefore, you should not increase the courses taken if the student is repeating a course. See output file for details. Additionally, after a course is added to the student record, that course should be inserted into the master linked-list of courses. If the course is already in the list, you should not repeat the course node. Instead, you should do something... (you should figure this out). Finally, output will be printed. See output file for details. 0 DELETE - used to delete student records from KAUdbms. This command will be followed by two Strings, the first name and last name of the record to delete. If the student record is not found, an error message should print. Otherwise, the student should be deleted and an appropriate message printed. See output file for details. 0 PRINTRECORD - this command is followed by two Strings, the first and last name of the student record you wish to print. If the student record is not found, an error message should print. Otherwise, the student record should print, including all personal information, their current level, their GPA, along with the courses they have taken and the grades received. See output file for details. FOR THIS ASSIGNMENT, USE THE FOLLOWING GPA CALCULATION. A IS 5 PTS. B IS 4 PTS. C IS 3 PTS. D IS 2 PTS. F IS 0 PTS. Now, to calculate the GPA, take the subtotal (51) and divide by the hours (12) to give 4.25. Q PRINTALLRECORDS - this command prints all student records in KAUdbms. See output file for details. 0 PRINTALLCOURSES - This command prints all courses that have ever been recorded in KAUdbms. The course name should be printed along with the average grade for that course. See output file for details. Qutput File YOUR PROGRAM MUST PRODUCE AN OUTPUT FILE, called "KAUdbms , out" THAT HAVE THE EXACT OUTPUT AS FOLLOWS SEARCHID Command ID 1112354 was not found in FCITbook. SEARCHNAME Command Zeinab Eid was not found in FCITbook. ADDCOURSE Command ERROR: cannot add course. Student ID \# 1112354 was not found in KAUdbms. DELETE Command Cannot Perform DELETE Command: Student (Imtiaz Khan) was not found in KAUdbms. PRINTRECORD Command Cannot Perform PRINTRECORD Command: Student (Jonathan Cazalas) was not found in KAUdbms. PRINTALLRECORDS Command Cannot Perform PRINTALLRECORDS Command: There are currently no student records saved in KAUdbms. NEWSTUDENT Command Jonathan Cazalas (ID 1117777) has been inserted as a new student in KAUdbms. NEWSTUDENT Command Ali AlGhamdi (ID 1112354) has been inserted as a new student in KAUdbms. PRINTRECORD Command Student Record for ID 1117777 First Name: Jonathan Last Name: Cazalas Email: jcazalas@kau.edu.sa Phone: 508881511 Age: 35 Level: 1st Year GPA: N/A Course Record: Student has not taken any courses ADDCOURSE Command CPCS204 (Grade: 10) has been added to the record of Student ID 1117777. ADDCOURSE Command CPCS222 (Grade: 98) has been added to the record of Student ID 1117777. ADDCOURSE Command CPCS223 (Grade: 99) has been added to the record of Student ID 1117777. ADDCOURSE Command CPCS324 (Grade: 100) has been added to the record of Student ID 1117777. PRINTRECORD Command Qurdant D sanal fow 1r 1 1 1 777 AUUUUUKSE Command CPCS204: grade has been changed/updated, to a 100, for Student ID 1117777. PRINTRECORD Command Student Record for ID 1117777 First Name: Jonathan Last Name: Cazalas Email: jeazalas@kau.edu.sa Phone: 508881511 Age: 35 Level: 1st Year GPA: 5.00 Course Record: Course ID: CPCS204 Grade: 100 Course ID: CPCS222 Grade: 98 Course ID: CPCS223 Grade: 99 Course ID: CPCS324 Grade: 100 PRINTRECORD Command Student Record for ID 1112354 First Name: Ali Last Name: AlGhamdi Email: aghamdi2354@kau.edu.sa Phone: 561158411 Age: 19 Level: 1st Year GPA: N/A Course Record: Student has not taken any courses ADDCOURSE Command CPCS204 (Grade: 87 ) has been added to the record of Student ID 1112354. ADDCOURSE Command CPCS222 (Grade: 92) has been added to the record of Student ID 1112354. ADDCOURSE Command CPCS223 (Grade: 72) has been added to the record of Student ID 1112354. ADDCOURSE Command CPCS324 (Grade: 76) has been added to the record of Student ID 1112354. PRINTALLCOURSES Command PRINTALLRECORDS Command Bilal Zahrani (ID 1418325) has been inserted as a new student in KAUdbms. NEWSTUDENT Command Muhammad Ashihiri (ID 1113289) has been inserted as a new student in KAUdbms. ADDCOURSE Command CPCS204 (Grade: 65 ) has been added to the record of Student ID 1418325. ADDCOURSE Command CPCS222 (Grade: 97) has been added to the record of Student ID 1418325. ADDCOURSE Command CPCS223 (Grade: 88 ) has been added to the record of Student ID 1418325. ADDCOURSE Command CPCS403 (Grade: 79) has been added to the record of Student ID 1418325. ADDCOURSE Command CPCS202 (Grade: 72) has been added to the record of Student ID 1113289. ADDCOURSE Command CPCS203 (Grade: 78) has been added to the record of Student ID 1113289. ADDCOURSE Command CPCS222 (Grade: 86) has been added to the record of Student ID 1113289. PRINTRECORD Command Course ID: CPCS203 Grade: 78 Course ID: CPCS222 Grade: 86 PRINTALLRECORDS Command CPCS111 (Grade: 90) has been added to the record of Student ID 1113289. ADDCOURSE Command CPCS112 (Grade: 90) has been added to the record of Student ID 1113289. ADDCOURSE Command CPCS113 (Grade: 90) has been added to the record of Student ID 1113289. ADDCOURSE Command CPCS114 (Grade: 90) has been added to the record of Student ID 1113289. ADDCOURSE Command CPCS115 (Grade: 90) has been added to the record of Student ID 1113289. ADDCOURSE Command CPCS116 (Grade: 90) has been added to the record of Student ID 1113289. PRINTRECORD Command Student Record for ID 1113289 First Name: Muhammad Last Name: Ashihiri Email: mashihiri3289@stu.kau.edu.sa Phone: 598461312 Age: 18 Level: 1st Year GPA: 4.44 Course Record: Course ID: CPCS111 Grade: 90 Course ID: CPCS112 Grade: 90 Course ID: CPCS113 Grade: 90 Course ID: CPCS114 Grade: 90 Course ID: CPCS115 Grade: 90 Course ID: CPCS116 Grade: 90 Course ID: CPCS202 Grade: 72 Course ID: CPCS203 Grade: 78 Course ID: CPCS222 Grade: 86 ADDCOURSE Command CPCS117 (Grade: 90) has been added to the record of Student ID 1113289. PRINTRECORD Command Student Record for ID 1113289 First Name: Muhammad Last Name: Ashihiri Email: mashihiri3289@stu.kau.edu.sa Phone: 598461312 Age: 18 Level: 2nd Year GPA: 4.50 Course Record: Course ID; CPCS111 Grade: 90 Course ID: CPCS112 Grade: 90 Course ID: CPCS113 Grade: 90 Course ID: CPCS114 Grade: 90 Course ID: CPCS115 Grade: 90 Course ID: CPCS116 Grade: 90 DELETE Command Student (Ali AlGhamdi) has been removed from KAUdbms. PRINTALLRECORDS Command A 11 aado navad in V A I takman DELEIE Command Student (Jonathan Cazalas) has been removed from KAUdbms. PRINTALLCOURSES Command All courses saved in KAUdbms: "- THE PROJECT MUST HAVE THESE FIVE FILES: 1. KAUstudent.java Class to create objects of type KAU student. These objects will be nodes of the BST. 2. KAUdbmsBST.java Class to create BST of KAUstudent objects 3. KAUcourse.java Class to create objects of type KAUcourse (to be used in the linked list of courses) 4. KAUcourses.java Class to create linked list of courses 5. KAUdbms. java This is your main programStep by Step Solution
There are 3 Steps involved in it
Step: 1
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