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]
3 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]3 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
Which graphics format works best for desktop publishing and print work? (1 point) .tiff .gif .tga .jpeg?
Sergeeva-Olga [200]
. jpeg, probably works best
6 0
2 years ago
Corey wrote a code that will display his name every time he presses the down arrow key but there is a bug in it. Display letter
brilliants [131]

Answer:

Explanation:

display letter c, type letter r, type letter o, type letter 3, type letter y- i think thats it but i dee cay this is confusing

7 0
3 years ago
Do you think that feedly will help you create an effective personal online learning environment? Why or why not?
goldenfox [79]

Yes. Feedly will help me create an effective personal online environment. I am able to keep up with all the topics that matter to me most. Feedly is able to help me discover insightful sources from publications and blogs. Feedly is also able to uniquely offer clean, minimalist reading experience optimized for productivity.

5 0
3 years ago
Once a business determines that change needs to occur, what ahould the
Lady bird [3.3K]

Answer:

D. Business strategy

Explanation:

Kono Dio Da!!

7 0
3 years ago
A user from the financial aid office is having trouble interacting with the finaid directory on the university's ERP system. The
Harlamova29_29 [7]

Answer:

A. The permissions on the finaid directory should be drwxrwxrwx.

Explanation:

The financial aid system is developed to record the fund inflow and outflows. The ERP system of the university has finaid system on which commands are run and output is received. The permissions on the finaid directory should be drwxr to enable the users to run the commands.

5 0
2 years ago
Other questions:
  • What is the typical relationship between time and interest rate?
    12·1 answer
  • A DSLR camera is made up of two parts. They are
    13·2 answers
  • When you’re in the Normal view, what are the visible panes?
    15·2 answers
  • 15
    5·2 answers
  • Write a Twitter class that sets the Twitter user first (who is to be followed) and lets the client add up to 5 followers, which
    10·1 answer
  • Which of the following is true regarding a class and interface types? Group of answer choices You can convert from a class type
    9·1 answer
  • How can you tell that a spreadsheet was saved as a 2007 Excel file?
    7·1 answer
  • Determine whether or not the following pairs of predicates are unifiable. If they are, give the most-general unifier and show th
    13·1 answer
  • Give an example of an occasion when you used logic to solve a problem
    7·1 answer
  • Connect research concepts to their definitions
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!