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

Code an application program (in java, using only command prompt (no JOptionPane)

ID: 3695779 • Letter: C

Question

Code an application program (in java, using only command prompt (no JOptionPane)) that keeps track of student information at your college. Include their names, identification numbers, and grade point averages in a fully encapsulated, homogeneous, linked-based binary search tree. When launched, the user will be presented with the following menu:

Enter: 1 to insert a new student's information,

2 to fetch and output a student's information,

3 to delete a student's information,

4 to update a student's information,

5 to output all the student information in descending order, and

6 to exit the program.

Do not implement a generic data structure in your solution and do not use any of the Java API prewritten classes pertaining to binary trees

Explanation / Answer

import java.util.*;

import java.*;

import java.io.*;

public class Exercise4 {

Student[] student = newStudent[5];

Module[] module = new Module[5];

int noOfStuds = 0;

int noOfMods = 0;

private Scanner scan;

public static void main(String[] args) throws IOException

{

Exercise4 studModProg = newExercise4

studModProg.menu();

}

public Exercise4({

scan = new Scanner(System.in);

}

public void menu()

{

int ans = 0;

System.out.println("MAIN MENU");

System.out.println("(1) - Add Student");

System.out.println("(2) - Delete Student");

System.out.println("(3) - Add Module");

System.out.println("(4) - Assign Student to Module");

System.out.println("(5) - Display Student Details");

System.out.println("(6) - Exit"));

System.out.println("Please Choose an option between 1-6");

ans = scan.nextInt();

switch(ans)

{

case 1:

addStudent();

break;

case 2:

delectStudent();

break;

case 3:

addModule();

break;

case 4:

assignStudToMod();

break;

case 5:

displayStuDetails();

break;

default: System.out.println("Incorrect choice");

menu();

break;

}

}

public void addStudent()

{

if (noOfStuds < 5)

{

scan = new Scanner(System.in);

student[noOfStuds] = newStudent();

System.out.println("Please enter Students name: );

student[noOfStuds].setName(scan.nextline());

System.out.println("Please enter enrollment date DD/MM/YY: ");

student[noOfStuds].setDate(scan.nextline());

noOfStuds++;

}

else

{

System.out.println("No More Students can be entered");

}

menu();

}

public void deleteStudent()

{

scan = new Scanner(System.in);

String searchName;

boolean found = false;

int loopCounter = 0;

System.out.println("Please Enter the student you wish to delete");

searchName = scan.nextLine();

while ((!found)&&(loopCounter < noOfStuds))

{

found = student[loopCounter].checkName(searchName);

{

loopCounter++;

}

}

}

public void addModule()

{

if (noOfMods < 5)

{

scan = new Scanner(System.in);

module[noOfMods] = new Module();

System.out.println("Please enter Module name: ");

module[noOfMods].setmodName(scan.nextline());

System.out.println("Please enter Semester: ");

module[noOfMods].setmodSem(scan.nextline());

noOfMods++;

}

else

}

public void assStuToMod()

{

System.out.println("Select First module");

System.out.println("Select 2nd module");

System.out.println("Select 3rd module");

}

public void disStuDetails()

{

System.out.println("Please Enter Student name for which details are required: ");

System.out.println("Hello I am a student and my name is ");

System.out.println("I am in year 2 and enrolled on

System.out.println("this year i take the following modules: ");

System.out.println("*********** running in semester *");

System.out.println("*********** running in semester *");

System.out.println("*********** running in semester *");

}

}

import java.util.Arrays;

public class Student{

private String name;

private String date;

public Student()

{

}

ublic Student(String studentName,String enrolDate)

{

name = studentName;

date = enrolDate;

}

public void setName(String name)

{

this.name = name;

}

public String getName(){

this.date = date;

}

public String getDate()

{

return date;

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote