Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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. Do not use GUIS.
1. public class Node 2. private String name; / key field private String address private String number; public Node (String n, String a, String num) 5. 6 name- n; addressa number num ; 10 public String toString 11 return(Name is name + InAddress is address+ InNumber is numbern) 14 15 public Node deepCopy() 16Node clonenew Node (name, address, number); return clone; 18. 19 public int compareTo (String targetKey) 20. return (name.compareTo(targetKey)); 21. 22. public void setAddress (String a) i coded to demonstrate 1 encapsulation 23. address a 24. 25 public void input() 26. name JOptionPane.showInputDialog( "Enter a name) 27. 28. 29. I end of inputNode method 30. end of class Node address JOptionPane.showInputDialog("Enter an address number JOptionPane.showInputDialog( "Enter a number")Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started