Question
Please help! I really appreciate your assistance!
I wish I had experience with java :( Thank you so very much!!
----------------------------------------------------------------------------
Write a program for keeping a course list for each student in a college. The information about each
student should be kept in an object that contains the student's name and a list of courses completed by
the student. The courses taken by a student are stored as a linked list in which each node contains the
name of a course, the number of units for the course, and the course grade. The program gives a menu
with choices that include adding a student's record, deleting a student's record, adding a single course
record to a student's record, deleting a single course record from a student's record, and printing a
student's record to the screen. The program input should accept the student's name in any combination of
upper- and lowercase letters. A student's record should include the student's GPA (grade point average)
when displayed on the screen. When the user is through with the program, the program should store the
records in a file. The next time the program is run, the records should be read back out of the file,
and the list should be reconstructed. (Ask your instructor if there are any rules about what type of
file you should use.)Note: You can use any type of file that you choose. A text file will be the easiest
to demonstrate that the data is correct.
Explanation / Answer
What do I need to change on my DoubleNodeLinkList_1 class to work with the TEST driver. I have been working on this for a day now and have not gotten anywhere. any help would be greatly appreciated. Thank you. public class DoubleNodeLinkList_1{ private Link head; private Link tail; /** * Constructor * @param head * @param tail */ public DoubleNodeLinkList_1() { head = null; tail = null; } /** * isEmpty method * @return head == null * returns if nothing is in the node */ public boolean isEmpty() { return head == null; } /** * addHeadNode method * @param node, adds node * to the head position */ public void addHeadNode(double node) { Link dll = new Link(node); if (isEmpty()) tail = dll; else head.prev = dll; dll.next = head; head = dll; } /** * addtailNode method * @param node, adds node * to the tail position */ public void addTailNode(double node) { Link dll = new Link(node); if (isEmpty()) head = dll; else { tail.next = dll; dll.prev = tail; } tail = dll; } /** * removeNode method * @param node1, node to be removed * @return null, if node can not be found * @return temp, if node was found */ public Link removeNode(double node1) { Link temp = head; while (temp.data != node1) { temp = temp.next; if (temp == null) return null; // cannot find it } if (temp == head) // found it; head item? head = temp.next; else temp.prev.next = temp.next; if (temp == tail) // tail item? tail = temp.prev; else // not tail temp.next.prev = temp.prev; return temp; // return value } /** * doubleLinkListForward method * print link list from head to tail */ public void doubleLinkListForward() { System.out.print("List (head to tail): "); Link temp = head; // start at beginning while (temp != null) // until end of list, { temp.displayLink(); temp = temp.next; // move to next link } System.out.println(""); } /** * doubleLinkListReverse * print link list from tail to head */ public void doubleLinkListReverse() { System.out.print("List (tail to first): "); Link temp = tail; while (temp != null){ temp.displayLink(); temp = temp.prev; } System.out.println(""); } class Link { /** * constructor * @param next * @param prev */ public double data; // data item Link next; // next link in list Link prev; // prev link in list /** * Link method * @param d */ public Link(double d) { data = d; } /** * displayLink method * prints the link list for: * doubleLinkListForward method * doubleLinkListReverse method */ public void displayLink() { System.out.print("[" + data + "], "); } }} _______________________________________________________________________________________ import java.util.*;public class TEST { /** * @param args */ public static void main(String[] args) { DoubleNodeLinkList_1 ab = new DoubleNodeLinkList_1(); ab.addHeadNode(new StudentRecord("Thom", 3.2, 284880847)); ab.addTailNode(new StudentRecord("David", 4.0, 575976520)); }} class StudentRecord{ private String name; private double gpa; private int ssn; public StudentRecord(String name, double gpa, int ssn) { name = this.name; gpa = this.gpa; ssn = this.ssn; } public String getName() { return name; } public void setName(String name) { this.name = name; } public double getGpa() { return gpa; } public void setGpa(double gpa) { this.gpa = gpa; } public int getSsn() { return ssn; } public void setSsn(int ssn) { this.ssn = ssn; }} u can also go throug the this link "http://java.sun.com/...cs-tutorial.pdf" this might helpfull to u......