Now we'll continue our project by writing a Facebook class that contains an ArrayList of Facebook user objects. The Facebook class should have methods to list all of the users (i.e. print out their usernames), add a user, delete a user, and get the password hint for a user. You will also need to create a driver program. The driver should create an instance of the Facebook class and display a menu containing five options:
Menu
1. List Users,
2. Add a User,
3. Delete a User,
4. Get Password Hint
5. Quit
Then it should read in the user's choice and call the appropriate method on the Facebook object. This should continue until the user chooses to quit. You dont need to worry about adding and removing "friends" for this assignment - well do that later in the project. Heres the catch: we want the contents of our Facebook object to persist between program executions. To do this, serialize your Facebook object before the program terminates. When the program starts up again, de-serialize the Facebook object rather than creating a new one.
Here are some details:
When adding a new FacebookUser, prompt the user for the username and check to see that if the users ArrayList already contains a FacebookUser object with that username. If it does, display an error message. If the username is unique, prompt for a password and password hint and create a new FacebookUser object with those values. Add this new user to the users ArrayList. When deleting a FacebookUser, prompt for the username and check to see that the users ArrayList contains a FacebookUser object with that username. If it doesn't display an error message. If it does, prompt for the password and check that the FacebookUser object with this username has the same password as the one that was entered. If it doesnt, display an error message. If the passwords match, delete this FacebookUser object from the users ArrayList When retrieving the password hint for a FacebookUser, ask for the username and display an error message if there is no user with that username. Obviously, if the user does exist you should display the password hint without requiring the users password.
You will be graded according to the following rubric (each item is worth one point):