I need a program that keeps track of specific information for Students. The info
ID: 3830833 • Letter: I
Question
I need a program that keeps track of specific information for Students. The information stored should be the following:
First Name, Last Name, Major, GPA, UIN, NetID, Age, Gender,
For this simple program we will only need to store 10 students in an LinkedList. Your students should be stored in an object called Student.You must create your own linked list and cannot use the LinkedList built into Java.
You should be able to add, display, sort (by any column you chose) and remove Students in the LinkedList.
Explanation / Answer
Hi Friend, this questions is big. it should be in two part.
First pArt: Developing Student Object with methods and attributes.
And then use Linked List. THere are lots of method to define in Linked list.
So, I have implemented Part 1: Defined Student class completely
public class Students {
// instance variable
private String firstName;
private String lastName;
private String major;
private double gpa;
private String uin;
private String netID;
private int age;
private String gender;
public Students() {
}
public Students(String firstName, String lastName, String major, double gpa, String uin, String netID, int age,
String gender) {
this.firstName = firstName;
this.lastName = lastName;
this.major = major;
this.gpa = gpa;
this.uin = uin;
this.netID = netID;
this.age = age;
this.gender = gender;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public String getMajor() {
return major;
}
public double getGpa() {
return gpa;
}
public String getUin() {
return uin;
}
public String getNetID() {
return netID;
}
public int getAge() {
return age;
}
public String getGender() {
return gender;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public void setMajor(String major) {
this.major = major;
}
public void setGpa(double gpa) {
this.gpa = gpa;
}
public void setUin(String uin) {
this.uin = uin;
}
public void setNetID(String netID) {
this.netID = netID;
}
public void setAge(int age) {
this.age = age;
}
public void setGender(String gender) {
this.gender = gender;
}
@Override
public String toString() {
return "First Name: "+firstName+" "+
"Last Name: "+lastName+" "+
"Major: "+major+" "+
"GPA: "+gpa+" "+
"UIN: "+uin+" "+
"Net Id: "+" "+
"Age: "+age+" "+
"Gender: "+gender;
}
}
Please repost this question with other requirement
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.