StudentNode - } public double getscore() { return score; }...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class StudentNode implements Comparable<StudentNode> { private int ID; private String name; private double score; private StudentNode link; p public StudentNode(int ID, String name, double score) { /* implement */ this.ID = ID; this.name = name; this.score = score; } public StudentNode(int ID, String name, double score, StudentNode link) { /* implement */ this.ID = ID; this.name = name; this.score = score; this.link = link; } // Implement accessor and mutator methods. public int getID() { return ID;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } public double getscore() { return score; } public StudentNode getlink() { return link; } public void set(int ID, String name, double score) { this.ID = ID; this.name = name; this.score = score; } public void setlink(StudentNode link) { this.link = link; } public int compareTo(StudentNode other) { /* implement */ if (score &gt; other.score) return 1; else return 0; } public String toString() { /* implement */ return ID + &quot; , &quot; + name + &quot; , &quot; + score; } }...
View Full Document

Ask a homework question - tutors are online