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 students = new ArrayList(); int option; //Iterate till user wants to quit while(true) { //Displaying menu option = menu(); //Calling corresponding functions switch(option) { //Add Student case 1: addStudent(students); break; //Display Student case 2: displayStudent(students); break; //Remove Student case 3: removeStudent(students); break; //Quit case 4: return; default: System.out.println(" Invalid option "); break; } } } public static int menu() { int ch; //Scanner class object Scanner reader = new Scanner(System.in); //Displaying menu System.out.print(" 1 - Add Student \t 2 - Display Student \t 3 - Remove Student \t 4 - Quit Your choice: "); //Reading menu option ch = reader.nextInt(); return ch; } //Method that adds a student public static void addStudent(ArrayList students) { //Scanner class object Scanner reader = new Scanner(System.in); //Prompting user for data System.out.println(" Enter student info(FirstName LastName Major GPA UIN NetID Age Gender): "); //Creating a temporary student object Student temp = new Student(); //Adding data temp.setFirstName(reader.next()); temp.setLastName(reader.next()); temp.setMajor(reader.next()); temp.setGPA(reader.nextDouble()); temp.setUIN(reader.next()); temp.setNetID(reader.next()); temp.setAge(reader.nextInt()); temp.setGender(reader.next()); //Adding to array list students.add(temp); System.out.println(" Student Successfully added... "); } //Method that displays student public static void displayStudent(ArrayList students) { System.out.println(" Students Available... "); //Iterating over student data for(int i=0; i students) { String name; //Scanner class object Scanner reader = new Scanner(System.in); //Reading student first name System.out.println(" Enter student FirstName to remove: "); name = reader.nextLine(); int pos = -1; //Iterating over student data for(int i=0; i

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!