Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Misr International University

Course Code & Title: SWE211 - Object Oriented Programming


Semester: Fall 2022
Instructor: Dr. Walaa Hassan
TAs: Eng. Maha Sayed
Eng. Nour Elhuda Ashraf
Eng. Youssef Talaat
__________________________________________________________________________________________

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.

You might also like