Professional Documents
Culture Documents
Lab 6
Lab 6
Lab 6
1. Create Class Student that has (Name, Id, Age, GPA, Department, Username, and
Password). Ask the user to enter the data of five students and store them in an arraylist of
type Student. Create 2 static methods in the Student Class; writeToFile that takes as
parameters a file and an arraylist of Student and store that array in the file, and
readFromFile that takes as parameter a file and return an arraylist of Students. In the main
method, write a code to test the two methods.
2. In the previous question, add two more static methods; logIn that takes Username and
Password and returns the Student Object with those Username and Password, and signUp
method that takes a new Student Object and add it to the arraylist. In the main method,
create a menu-driven code to test all the static methods.