cs260
assignment three
facebook object-based system
Due: Sunday, Oct 25 2009
Monica Anderson
Revision Date: October 20, 2009
Printable Version
Your assignment is to modify and augment the facebook search system from assignment one
Rewrite the original facebook search assignment to include the original search and selection features.
New features that will be made available to the user include graph statistics, addition of friends and
relationships and writing of updated database to a file.
Old functions:
- Search for partial name (return all matches and display relationship for selected matches)
New Functions:
- Add new friend (using prompts for first and last name)
- Delete friend
prompt for friend name, search if needed on a partial name match and select from list
display existing relationships
confirm deletion
delete relationships; delete friend
- Add relationships
prompt for first friend name, search if needed on a partial name match and select from list
prompt for second friend name, search if needed on a partial name match and select from list
verify that this is not a duplicate relationship
confirm relationship addition for two friends before adding
- Delete relationship
prompt for first friend name, search if needed on a partial name match and select from list
display existing relationships
allow user to select relationship to delete via menu
delete relationship; display remaining relationships for first person
- Print statistics data for all data
number of nodes (friends) and number of edges (relationships)
- Print statistics data for a selected friend
prompt for friend name, search if needed on a partial name match and select from list
print degree (number of relationships), and degree centrality (number of relationships / number of nodes-1)
- Exit
write database to a file so that it can be read in when the program is restarted
Appropriate data structures should be used for maintaining friend and relationship information.
It is expected that there will a container that holds all friends. The container for friends
should only have attibutes and methods appropriate for the container. Encapsulation of
data should hide implementation details of attibutes and storage decisions.
Points will be deducted for not adhering to the specifications given in this document and in the grading
rubric. Points will be deducted for bad style, especially unreasonable amounts of duplicated code, as well
as for sloppy formatting, insufficient or overly verbose documentation, compiler warnings, run-time crashes,
and other such transgressions. You will receive no credit if your program fails to run to completion on all
tests.
An assignment that earns an A will:
- Use appropriately designed classes and methods to reduce duplication of code, useful variable and function names
- Will have an appropriately designed classes with methods and attributes.
- Not hardcode the number of friends.
- Be case agnostic on search strings but print the appropriate case
- Read the file only once while the program is running and write the program upon exit
- Will validate that a selected friend from the list is a valid choice or will ask for the friend selection
again
- Will print appropriate messages when no friend relationships are found or the name search is not successful
- Comments in the program that explains each function and variable and important flow/assignments
To submit your assignment, while in your working directory, type the command
submit cs260 anderson project3
The submit program will bundle up all the files in your current directory
and ship them to me. Thus it is very important to delete any extraneous
files in your directory. This includes subdirectories as well since all
the files in any subdirectories will also be shipped to me. I will deduct
points for extraneous files, so be careful.
You may submit as many times as you want;
new submissions replace old submissions.
lusth@cs.ua.edu