Write a program for ATILIM FACE. Your program will keep track of the users of the ATILIM FACE as well as the information about their friends. The users will be able to add, delete or list their friends. Also as a bonus, write a module where the program suggests new friends to a user.
You are given the following two text files:
Users.txt: The file keeps the email as username and password info of the users. Ex: username = mary@yahoo.com and password = mary
mary@yahoo.com mary
matt@hotmail.com matt
bob@gmail.com bob
sam@gmail.com sam
jack@gmail.com jack
nick@gmail.com nick
kathy@gmail.com kathy
nancy@gmail.com nancy
Friends.txt: The file keeps the username and the friends of the user. Ex: The user with mary@yahoo.com username has three friends including “jack@gmail.com”,” matt@hotmail.com”,” kathy@gmail.com”.
mary@yahoo.com jack@gmail.com matt@hotmail.com kathy@gmail.com
matt@hotmail.com nancy@gmail.com nick@gmail.com kathy@gmail.com mary@yahoo.com
bob@gmail.com sam@gmail.com kathy@gmail.com
sam@gmail.com bob@gmail.com
jack@gmail.com mary@yahoo.com
nick@gmail.com matt@hotmail.com
kathy@gmail.com mary@yahoo.com bob@gmail.com matt@hotmail.com
nancy@gmail.com matt@hotmail.com
The user information will be kept in an array of at most 20 elements. Each array element will store the username, password of the user as well as a linked list of the user’s friends. Each node of the linked list will store a friend’s username.
When a user enters the system, the program should check if his/her password is correct. If incorrect password is entered, the program should issue a warning message.
If the user chooses the “New Friend” command, make sure that the friend to be added is one of the users. For this operation, the new friend will be added to the user’s friend list, and the user will be added to the friend’s friend list.
For the “List Friend” operation, all the friends of a user will be listed.
For the “Delete Friend” operation, the username entered should be deleted from the user’s friends list, and also the user should be deleted from the deleted user’s friends list.
[BONUS] For the “Suggest Friends” operation, new friends will be suggested to a user who are the friends of the user’s friends.
When “Quit” is entered, make sure you update the “Friends.txt” file.
Welcome to ATILIM FACE
Login
Username: mary@yahoo.com
Password: mary
N (New Friend) | L (List Friends) | D(Delete Friend) | S (Suggest Friends) | Q(Quit)
Enter your choice of action: N
Enter email: bob@gmail.com
bob@gmail.com is your friend now…
N (New Friend) | L (List Friends) | D(Delete Friend) | S (Suggest Friends) | Q(Quit)
Enter your choice of action: L
Your friends:
jack@gmail.com
matt@hotmail.com
kathy@gmail.com
bob@gmail.com
N (New Friend) | L (List Friends) | D(Delete Friend) | S (Suggest Friends) | Q(Quit)
Enter your choice of action: D
Enter email: kathy@gmail.com
matt@hotmail.com is not a friend anymore…
N (New Friend) | L (List Friends) | D(Delete Friend) | S (Suggest Friends) | Q(Quit)
Enter your choice of action: L
Your friends:
jack@gmail.com
matt@hotmail.com
bob@gmail.com
N (New Friend) | L (List Friends) | D(Delete Friend) | S (Suggest Friends) | Q(Quit)
Enter your choice of action: S
You may know these people:
nancy@gmail.com
nick@gmail.com
sam@gmail.com
N (New Friend) | L (List Friends) | D(Delete Friend) | S (Suggest Friends) | Q(Quit)
Enter your choice of action: Q
Thank you for using ATILIM FACE…
Bye…
Don’t forget: Once the user chooses quit operation, make sure that Friends.txt file is updated.
Friends.txt (mary added bob as new friend)
mary@yahoo.com jack@gmail.com matt@hotmail.com kathy@gmail.com bob@gmail.com
matt@hotmail.com nancy@gmail.com nick@gmail.com kathy@gmail.com mary@yahoo.com
bob@gmail.com sam@gmail.com kathy@gmail.com mary@yahoo.com
sam@gmail.com bob@gmail.com
jack@gmail.com mary@yahoo.com
nick@gmail.com matt@hotmail.com
kathy@gmail.com mary@yahoo.com bob@gmail.com matt@hotmail.com
nancy@gmail.com matt@hotmail.com
Friends.txt (mary is not friend with kathy anymore)
mary@yahoo.com jack@gmail.com matt@hotmail.com bob@gmail.com
matt@hotmail.com nancy@gmail.com nick@gmail.com kathy@gmail.com
bob@gmail.com sam@gmail.com kathy@gmail.com mary@yahoo.com
sam@gmail.com bob@gmail.com
jack@gmail.com mary@yahoo.com
nick@gmail.com matt@hotmail.com
kathy@gmail.com bob@gmail.com matt@hotmail.com
nancy@gmail.com matt@hotmail.com