1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nadya [2.5K]
4 years ago
9

Code an application program that keeps track of student informationat your college . Include their name, identification numbers,

and grade point averages in a fully encapsulated homogenous singly linked list. When launched the user will be asked to input the initial number of students and the initial data set. Once this is complete, 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, and
6 to exit the program.

The program should perform an unlimited number of operations until the user enters a 6 to exit the program. If the user requests an operation on a node not in the structure, the program output should be "node not in structure." Otherwise, the message "operation complete" should be output.

Computers and Technology
1 answer:
timurjin [86]4 years ago
6 0

Answer:

The full code is added in the comments as per regulations. Continuation of driver.java code from the comments is available on the screenshot

Explanation:

Editable code:

//ListingNode.java

class ListingNode {

   private listpro listing11;

   private ListingNode nextnode;

   public ListingNode(listpro listing11) {

       this.listing11 = listing11;

   }

   public listpro getListing() {

       return listing11;

  }

   public void setListing(listpro listing11) {

       this.listing11 = listing11;

   }

   public ListingNode getnextnode() {

       return nextnode;

   }

   public void setnextnode(ListingNode nextnode) {

       this.nextnode = nextnode;

   }

}

public class Listlinked {

   private ListingNode headnode;

   public Listlinked() {

       headnode = null;

   }

   public void insert(listpro listing11) {

       ListingNode listingNode = new ListingNode(listing11);

       if(headnode == null) {

           headnode = listingNode;

       } else {

           ListingNode tempval = headnode;

           while (tempval.getnextnode() != null) {

               tempval = tempval.getnextnode();

           }

           tempval.setnextnode(listingNode);

       }

   }

   public listpro fetch(String name) {

       ListingNode tempval = headnode;

       while (tempval != null) {

           if(tempval.getListing().getNamedata().equalsIgnoreCase(name)) {

               return tempval.getListing();

           }

           tempval = tempval.getnextnode();

       }

       return null;

   }

   public boolean delete(String name) {

       ListingNode tempval = headnode;

       boolean found = false;

       if(headnode != null) {

          if(headnode.getListing().getNamedata().equalsIgnoreCase(name)) {

               headnode = headnode.getnextnode();

               found = true;

           } else {

               while (tempval.getnextnode() != null) {

                   if (tempval.getnextnode().getListing().getNamedata().equalsIgnoreCase(name)) {

                       found = true;

                       tempval.setnextnode(tempval.getnextnode().getnextnode());

                       break;

                   }

                   tempval = tempval.getnextnode();

               }

           }

       }

       return found;

   }

   public void printAll() {

       ListingNode tempval = headnode;

       while (tempval != null) {

           System.out.println(tempval.getListing().toString());

           tempval = tempval.getnextnode();

       }

   }

}

//listpro.java

import javax.swing.*;

public class listpro {

   private String Name;

   private int ID;

   private float grade_point;

   public listpro(){

   }

 public listpro(String Name, int ID, float grade_point){

       this.Name = Name;

       this.ID = ID;

       this.grade_point = grade_point;

   }

   public String getNamedata() {

       return Name;

   }

   public void setNamedata(String Name) {

       this.Name = Name;

   }

   public int getID() {

       return ID;

   }

   public void setID(int ID) {

       this.ID = ID;

   }

   public float getgrade_point() {

       return grade_point;

   }

   public void setgrade_point(float grade_point) {

       this.grade_point = grade_point;

   }

   public listpro deepCopy(){

       listpro clone = new listpro(Name,ID,grade_point);

       return clone;

   }

   public String toString(){

       return "Name : " + Name + "\nID :" + ID + "\nGrade points :" + grade_point;

   }

   public void input(){

       Name = JOptionPane.showInputDialog("Enter a Name");

       ID = Integer.parseInt(JOptionPane.showInputDialog("Enter an ID"));

       grade_point = Float.parseFloat(JOptionPane.showInputDialog("Enter a grade point average"));

   }

}

You might be interested in
Why might you need to convert a file to another file type?
Elis [28]
c i belive that is the right answer

5 0
3 years ago
Read 2 more answers
What application or interface allows you to configure security filtering?
Nat2105 [25]
<span>Group Policy Management console.</span>
6 0
3 years ago
Which component of a computer is its input device and what role does it play in a document?
kogti [31]
The keyboard is used to input information. (Entering data)
5 0
3 years ago
Read 2 more answers
Noah would like to center and underline the title. Which of the following steps should Noah follow?
Tresset [83]

Answer:

Option 3 - Type the title, highlight the text, select the underline command, and select the centering command.

6 0
3 years ago
The term _____ distinguishes the person who uses a hardware or software product from the IT workers who develop, install, servic
adell [148]

Answer:

"It user" is the correct answer for the above question.

Explanation:

  • It users are the user who is generally using the computers and the It system for their work.
  • But the It workers works is to install the service and to develop the service for the IT users.
  • Hence anybody can say that there is a many difference between It user and the IT workers.
  • The above question-statement also wants to states the same difference between the IT user and the It workers. So after putting the "it user" in the above question blanks the statement means the same. Hence "IT user" is the correct answer.
8 0
4 years ago
Other questions:
  • In a C++ program, two slash marks ( // ) indicate:
    7·1 answer
  • ​_____ was the first commercially successful computer. ​z3 ​eniac ​univac ​colossus
    13·1 answer
  • How do the World Wide Web and the Internet work together?
    11·1 answer
  • How to show neither precious nor accurate
    13·1 answer
  • All of the following are ways to save money on transportation except :
    7·1 answer
  • Use the _______ to add a line or circle to your presentation.
    8·1 answer
  • Concept about borderless classroom because of technology​
    9·1 answer
  • What are the network topologies? Advantages and disadvantages.
    9·1 answer
  • 1. Would it be possible for two people to have the same email address? Explain.
    9·2 answers
  • What will the following program display in the console?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!