Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is using Java with a Linked List and SHOULD NOT use the JOptionPane. Please be sure to include the intital number of students and

This is using Java with a Linked List and SHOULD NOT use the JOptionPane. Please be sure to include the intital number of students and the intitial data set mentioned in the instructions. Thanks!

27. Code Java application program that keeps track of student information at your college (see Exercise 25). Include their names, identification numbers, and grade point averages in a fully encapsulated, homogeneous 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. Here is Excercise 25 A database is to be developed to keep track of student information at your college. It will include their names, identification numbers, and grade point averages. The data set will be accessed in the key field mode, with the student's name being the key field. Code a class named Listing that defines the nodes. Your class should include all the methods in the class shown in Figure 2.28. Test it with a progressively developed driver program that demonstrates the functionality of all of its methods.

Figure 2.28

image text in transcribed

1. public class Node 2. private String name; I key field private String address; private String number; public Node (String n, String a, String num) 6 name = n ; address a; number num ; 10 11, 12 public String tostring0 { return ("Name is + name + nAddress isaddress+ InNumber is+number+"In) 15 16 17 public Node deepCopy() { Node clone = new Node (name, address, number); return clone; 19. 20 21 public int compareTo (String targetKey) return (name.compareTo (targetKey)); public void setAddress(String a) II coded to demonstrate /I encapsulation 23 24 25. 26 27 28 29. 30. address = a; public void input() name JOptionPane.showInputDialog("Enter a name"); address = JOptionPane, showinputDialog ("Enter an address"); number = JOptionPane. showinputDialog ("Enter a number.); end of inputNode method end of class Node 1. public class Node 2. private String name; I key field private String address; private String number; public Node (String n, String a, String num) 6 name = n ; address a; number num ; 10 11, 12 public String tostring0 { return ("Name is + name + nAddress isaddress+ InNumber is+number+"In) 15 16 17 public Node deepCopy() { Node clone = new Node (name, address, number); return clone; 19. 20 21 public int compareTo (String targetKey) return (name.compareTo (targetKey)); public void setAddress(String a) II coded to demonstrate /I encapsulation 23 24 25. 26 27 28 29. 30. address = a; public void input() name JOptionPane.showInputDialog("Enter a name"); address = JOptionPane, showinputDialog ("Enter an address"); number = JOptionPane. showinputDialog ("Enter a number.); end of inputNode method end of class Node

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 15th International Conference Dasfaa 2010 Tsukuba Japan April 2010 Proceedings Part 1 Lncs 5981

Authors: Hiroyuki Kitagawa ,Yoshiharu Ishikawa ,Wenjie Li ,Chiemi Watanabe

2010th Edition

3642120253, 978-3642120251

More Books

Students also viewed these Databases questions

Question

5. Describe the visual representations, or models, of communication

Answered: 1 week ago