Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please i need to solve this Question with java code and using class node please

ID: 3837753 • Letter: P

Question

please i need to solve this Question with java code

and using class node please

A) Write a class Student that has these private fields:

String name
Integer ID
Double GPA
Integer N (Number of quizzes taken by this student) Array of N integers (grades of the quizzes)

And these public methods:

double quizzesAvg (which computes and returns the quizzes average grade) void print, which prints all the data of the Student.
void setGPA (to change the GPA to a new value)

Design a 4-parameter constructor (name, ID, GPA and quizzes array). Any trial to enter a negative quiz grade must generate the exception: negativeNotAllowed and the handler within the constructor must replace the negative grade with Zero.

The GPA must be in range [0..4]. If not, the constructor must throw the exception GpaRangeException to the caller. The test class (the caller) must handle this problem in any suitable way (Example: Skip that Student and generate a log text file of that error).

B) Write a class Node (which represents a single Node in a Binary Tree).

C) Write a class StudentTree (a binary Tree of students, based on their IDs), which has the following public methods:

Insert (Notice that it is not allowed to have a duplicated ID’s, use a boolean search method to verify that)

Delete a student (given his/her ID)

Print the whole Tree (In-Order Traversal)

Compute the maximum quizzes average grade over all students.

Change the GPA of a certain student (given his/her ID)

D) Write a menu-driven program that starts with reading students data from a formatted text file (or a serial file) and inserting them in a Tree of students. Your program must have the above five functionalities as menu options. At end, the program updates all the students’ data in the same file with the new (modified) data at the end of the run.

E) Choosing the file name must be through a GUI. " by using file chosser "

Explanation / Answer

class StudentGpa

{
public static void main(String args[])

{
int marks[]=new int [6];

int k;

float sum=0,average;

Scanner scan =new Scanner;

System.out.print("Enter marks obtained in 6 subjects");

for(k=0;k<6;k++)
{
mark[k]=scan.nextInt();

sum=sum+mark[k];

}

average sum/6;

System.out.print("grade is");

it=L.iterator;

while(it.hasNext())

{

stud=(Student)it.next();

if(stud.rno==no)

{
found=1;

pos=L.indexOf(stud);

L.remove(pos);

perfect=stud.read_data();

if(perfect==1)

L.add(pos,sud);

break;

}

}
if(found!=0)

System.out.println(" proll_no not presnt so record not updated");

break;

case4:System.out.print("enter rollno to search record");

no=Integer.parseInt(br.readLine());

found=0;

it=L.iterator();

while(it.hasNext())

{

stud=(Student)it.next();

if(stud.rno==no)

{

found=1;

pos=L.indexOf(stud);

system.out.printLn(" Record found at"+pos+"Position ");

stud.show_data();

break;

}

}

if(found!=1)

System.out.println(" Roll_no not present so record not found");

break;

case 5:System.out.print(" Enter roll no to delete record:");

no=Integer.parseInt(br.readLine());

found=0;

it=L.iterator();

while(it.hasNext())

{

stud=(Student)it.next();

if(stud.rno==no)

{

found=1;

L.remove(stud);

System.out.print(" record deleted successfully ");

break;

}

}

if(found!=1)

System.out.printn(" Roll_no not present so record not deleted ");

break;

case 6: System.out.println(" |----*Student details*----|");

System.out.println("|-------|");

System.out.println("|Roll no Name Percentage|");

System.out.println("|-------|");

it=L.iterator();

while(it.hasNext())

{

stud=(Student)it.next();

stud.show_data();

}

System.out.println("|-------|");

break;

case 7:System.exit(0);

}

}

catch(NumberForamtException n)

{

System.out.println("Exception "+n);

}

}while(ch!=7);

}

if(avg>80)

{

System.out.println("distinction");

}
else if(avg>60 && avg<=80)

{

System.out.println("A");

}

else if(avg>40 && avg<=60)

{
   System.out.println("B");
}

class Details

{

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

int id;

String name;

double percent;

int read_data() throws IOException

{

try

{

System.out.print("stu id:");

rno=Integer.parseInt(br.readLine());

if(rno<0)

throw new NagativeNumberException();

System.out.println("Name :");

name=br.readLine();

System.out.print("percentage:");

per=Double.parseDouble(br.readLine()):

if(per<0)

throw new NegativeNumberException();

}

catch(NegativeNumberException n)

{
System.out.println("Exception :Number Must be Positive");

retun 0;

}

return 1;

}

void show_data()

{
System.out.println("|"+rno+" |"+name+"|"+per+"|");

}
}

System.out.println("B");

}

else if(avg>35 && avg<=40)

{

System.out.println("C");

}

else

{

System.out.println("fail");

}

}

}

class Student

{
public static void main(string args[])

{

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

Student stud;&stud;);

break;

System.out.println(" Enter positon where to insert record:");

pos=Integer.parseInt(br.readLine());

System.out.println("|-------|");

System.out.println("| [1]:Add |");

System.out.println("| [2]:Insert |");

System.out.println("| [3]:Update |");

System.out.println("| [4]:Search |");

System.out.println("| [5]:Delete |");

System.out.println("| [6]:Print |");

System.out.println("| [7]:Exit |");

System.out.println("|-------|");

System.out.print(" Enter choice:");

try

{
ch=Integer.parseInt(br.readLine());

switch(ch)

{
case1:System.out.println(" Enter Stud Details ");

stud=new Student();

perfect=stud.read_data()

if(perfect==1)

L.add(stud);

break;

case 2:System.out.println(" Enter Position where to insert record:");

pos=Integer.parseInt(br.readLine());
}

if(pos>L.size())

{

System.out.println(" Position out of range ");

break;

}

stud=new Student();

perfect=stud.read_data();

if(perfect==1)

L.add(pos,stud);

break;

case 3:System.out.println(" Enter roll no to update record:");

no=Integer.parseInt(br.readLine());

found=0;
}
}