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 diagram is NOT a good model of 3÷14?
swat32
I need a pic for this
7 0
2 years ago
Read 2 more answers
Which of the following statements is not true of web storage?
slavikrds [6]

Answer:

The data in web storage is passed to the server with every HTTP request.

Explanation:

There are basically two Web storage APIs Session storage and local storage.Both can store data up to 5MB. They are supported by every modern browser.You can store data in local storage indefinitely and for browser session in session storage.There is no data or information in HTTP request header.So we conclude that option 4 is the answer.

3 0
2 years ago
In cyber security, one of the best ways to protect a computer or network is with a strategy called defense in depth. This strate
emmainna [20.7K]

This idea is most closely related to the Layering in terms of how to reduce complexity.

<h3>Describe cybersecurity?</h3>

The term "cybersecurity" refers to the safeguarding of computer systems and networks against the leakage, theft, or destruction of data as well as the interruption of the services they offer.

Defense in depth is a technique used in cybersecurity that is one of the greatest ways to safeguard a computer or network. If one fails, it's likely that another will identify the issue. The approach to simplifying that is most in line with is called layering.

Thus, This idea is most closely related to the Layering in terms

For further details about cybersecurity, click here:

brainly.com/question/13016321

#SPJ1

5 0
2 years ago
Read 2 more answers
How to solve level 53 on rapid router?
alexgriva [62]

&lt;img src=/static/game/image/actions/go.svg alt=' + ugettext(play= button)= += '= style=width: 4%;&gt; ) def noPermissionMessage():

6 0
1 year ago
Few companies today could realize their full-potential business value without updated ________. Select one: a. IT investments ma
Alenkasestr [34]

Answer:

b. IT infrastructures and services

Explanation:

IT infrastructure or information technology infrastructure refers to the various components involved in the functioning of an IT enabled operations. These components include; hardware, software, network resources, etc.

It is usually internal to an organization and deployed within the confines of its own facilities.

6 0
3 years ago
Other questions:
  • Which domain indicates that a website is sponsored by a university or college?
    12·1 answer
  • Select all the sets that are countably infinite. Question 3 options: the set of real numbers between 0.1 and 0.2 the set of all
    12·1 answer
  • I need le help, darn ijourneys
    10·2 answers
  • Hewo everyone look at me I look ugly don't I<br>​
    6·2 answers
  • Neymar machine that Run on electricity
    11·1 answer
  • Help!!
    15·1 answer
  • Why do you usually find domain names instead of IP addresses in a URL? Select one: a. An IP address would make your web page loa
    11·1 answer
  • Which is an example of machine-to-machine communication?
    7·1 answer
  • 5. Why do we need programming language?​
    13·2 answers
  • Difference between copy command and cut command
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!