Question: Create a GUI for this particular project. You can use the lab 4 solution that youve submitted. Your GUI is completely up to you and
Create a GUI for this particular project. You can use the lab 4 solution that youve submitted.
Your GUI is completely up to you and should display all information that you find useful. It should be intuitive and informative.
Create 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 ArrayList. Your students should be stored in an object called Student.
You should be able to add, display, sort (by any column you chose) and remove Students in the ArrayList.
Hint: To make your life easier take your previous lab solution and add a menu bar instead of adding a lot of new items.
Here is my lab 4 code:
import java.util.*;
public class Lab4 { //Main method public static void main(String[] args) { //Array list ArrayList public class Student { //Private member variables private String FirstName; private String LastName; private String Major; private double GPA; private String UIN; private String NetID; private int Age; private String Gender; //Constructor that assigns default values public Student() { this.FirstName = ""; this.LastName = ""; this.Major = ""; this.GPA = 0; this.UIN = ""; this.NetID = ""; this.Age = 0; this.Gender = ""; } //Constructor that assigns values public Student(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; } //Getter for first name public String getFirstName() { return FirstName; } //setter for first name public void setFirstName(String FirstName) { this.FirstName = FirstName; } //Getter for last name public String getLastName() { return LastName; } //Setter for last name public void setLastName(String LastName) { this.LastName = LastName; } //Getter for major public String getMajor() { return Major; } //Setter for major public void setMajor(String Major) { this.Major = Major; } //Getter for GPA public double getGPA() { return GPA; } //Setter for GPA public void setGPA(double GPA) { this.GPA = GPA; } //Getter for UIN public String getUIN() { return UIN; } //Setter for UIN public void setUIN(String UIN) { this.UIN = UIN; } //Getter for NetID public String getNetID() { return NetID; } //Setter for NetID public void setNetID(String NetID) { this.NetID = NetID; } //Getter for age public int getAge() { return Age; } //Setter for age public void setAge(int Age) { this.Age = Age; } //Getter for gender public String getGender() { return Gender; } //Setter for gender public void setGender(String Gender) { this.Gender = Gender; } //Tostring method @Override public String toString() { return "Student{" + "FirstName=" + FirstName + ", LastName=" + LastName + ", Major=" + Major + ", GPA=" + GPA + ", UIN=" + UIN + ", NetID=" + NetID + ", Age=" + Age + ", Gender=" + Gender + '}'; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
