CST8130: Data Structures — Assign #3- Email Lists

$35.00

Category: You will Instantly receive a download link for .zip solution file upon Payment

Description

5/5 - (4 votes)

Using Multiple Generic Data Structures – LinkedList and ArrayList
In this assignment, you will write a system to
manage email address lists (ostensibly so that
you could send emails to a list which has a
name – which would send an email to each of
the addresses in the list – although we will not
actually implement sending emails. Displaying
the list will simulate being able to send the
emails). We will use multiple Java Generic data
structures to hold the data. We could add
MUCH to this program – I am providing
specifications for the very basics that must be
completed for this assignment to manage your
time.
Basic Requirements:
1. An email address (which will be defined in
the EmailAddress class) is a String. Much
editing could be done on this field – but the
minimum for this assignment is that it must
contain at least one ‘@’ and one ‘.’ and is at
least 7 chars long. I have written this class
for you – it is published with this assignment.
2. An email address list (EmailList class) will
contain two fields – a String name of the list,
and a LinkedList of EmailAddress objects.
Note – be sure to know why a LinkedList is
an effective structure to use for this data.
3. The Directory class will hold handle an
ArrayList of EmailList objects. As we will
need to search for EmailLists – we will want
to keep these entries sorted by the name of
the list.
4. Main should have a menu which allows the
following choices:
• the creation of a new EmailList that is
added to the EmailLists ArrayList;
• display of all the EmailLists in the
ArrayList
• addition of an EmailAddress to an
existing EmailList in the ArrayList
• deletion of an EmailAddress in an
existing EmailList
• display a particular EmailList
• read in EmailLists from a file
5. You must use these class names and the
default package. Be sure to ensure you are
adhering to all Object Oriented Principles as
have been covered in the class. In
particular, all fields must be declared as
private. (If you don’t specify this – the
default is public). Also, we will continue in
this assignment to NOT use get/set
methods.
6. All possible error conditions must be
handled. No program abending is allowed.
No System.exit() calls are allowed.
7. File input – you don’t need to use .nextLine()
method….you can use .next() method as it
handles the new line character.
EmailLists.txt file format:
This file contains the following format:
• An int – number of email lists contained
in the file
• Then for each email list
o The name of list
o An int – number of email
addresses in the list to follow
o The email addresses
Sample file – EmailLists.txt:
2 CST8130Class 4
linda.crane@algonquincollege.com
susieSmith@rogers.com
sallys@gmail.com
perfectStudent@hotmail.com
Friends 2 mickeyMouse2gmail.com
donaldDuck@gmail.com
Submission:
You must submit to the assignment link in
Blackboard by the due date and time a zip file
(named LastnameFirstNameAssign3)
containing:
• all source code – ie .java files (Note – I
may choose to re-compile your
program….so all code must be available
to me) with
• Your test plan in either .docx or .xls
format
CST8130 – Data Structures Assign3: Email Lists
2
Failure to provide any of the above will have an
effect on your grade for this assignment.
Marking guide will be published shortly.
Hints:
START THIS ASSIGNMENT TODAY! This
assignment needs to be tackled in a structured
fashion in order for it to be finished in a timely
fashion.. Do not write more than 20-30 lines of
code at a time without running your program.
Enjoy!!
1. Start with a memory map of what the
declaration of a Directory object will look like
in memory. I will do in class on Oct 25!
2. Write your menu in main to get it working –
then add the code for one selection at a
time.
3. Start with create a list menu selection,
followed by display list menu selection.
4. Now you can add the file input menu
selection (and check it worked by executing
the display list menu selection)
5. Now you can add the display a particular list
followed by the add an address and delete
an address menu selections.
Sample Output:
Enter c to create a new list
p to display all the email
lists
a to add an entry to a list
d to delete an entry from a
list
l to display a list
f to load lists from file
q to quit:f
Enter name of file to process:
c:\emaillists.txt
Enter c to create a new list
p to display all the email
lists
a to add an entry to a list
d to delete an entry from a
list
l to display a list
f to load lists from file
q to quit:p
The email lists are:
ExtendedFamily:[cousin1@rogers.com,
cousin2@rogers.com,
cousin3@rogers.com,
cousin4@rogers.com,
cousin5@rogers.com,
cousin6@rogers.com,
cousin7@rogers.com,
cousin8@rogers.com,
cousin9@rogers.com,
cousin10@rogers.com]
Work:[boss@hotmail.com]
Family:[brother@rogers.com,
sister@rogers.com,
mother@rogers.com,
father@rogers.com]
Friends:[mickeyMouse@gmail.com,
donaldDuck@gmail.com]
CST8130Class:[linda.crane@algonquin
college.com, susieSmith@rogers.com,
sallys@gmail.com,
perfectStudent@hotmail.com]
Enter c to create a new list
p to display all the email
lists
a to add an entry to a list
d to delete an entry from a
list
l to display a list
f to load lists from file
q to quit:c
Enter the name of the list:NewList
Enter valid email
addressjoe@hotmail.com
Another? y/n:y
Enter valid email
addressjoe2#gmail.com
Enter valid email address…must
contain @ and .:joe2@gmail
Enter valid email address…must
contain @ and .:joe2@gmail.com
Another? y/n:n
Enter c to create a new list
p to display all the email
lists
a to add an entry to a list
d to delete an entry from a
list
l to display a list
f to load lists from file
q to quit:l
Enter name of list to display:
NewList
NewList:[joe@hotmail.com,
joe2@gmail.com]
Enter c to create a new list
p to display all the email
lists
a to add an entry to a list
d to delete an entry from a
list
CST8130 – Data Structures Assign3: Email Lists
3
l to display a list
f to load lists from file
q to quit:p
The email lists are:
ExtendedFamily:[cousin1@rogers.com,
cousin2@rogers.com,
cousin3@rogers.com,
cousin4@rogers.com,
cousin5@rogers.com,
cousin6@rogers.com,
cousin7@rogers.com,
cousin8@rogers.com,
cousin9@rogers.com,
cousin10@rogers.com]
NewList:[joe@hotmail.com,
joe2@gmail.com]
Work:[boss@hotmail.com]
Family:[brother@rogers.com,
sister@rogers.com,
mother@rogers.com,
father@rogers.com]
Friends:[mickeyMouse@gmail.com,
donaldDuck@gmail.com]
CST8130Class:[linda.crane@algonquin
college.com, susieSmith@rogers.com,
sallys@gmail.com,
perfectStudent@hotmail.com]
Enter c to create a new list
p to display all the email
lists
a to add an entry to a list
d to delete an entry from a
list
l to display a list
f to load lists from file
q to quit:a
Enter name of list to add to:
Work
Enter valid email
addressboss2@gmail.com
Enter c to create a new list
p to display all the email
lists
a to add an entry to a list
d to delete an entry from a
list
l to display a list
f to load lists from file
q to quit:l
Enter name of list to display:
Work
Work:[boss@hotmail.com,
boss2@gmail.com]
Enter c to create a new list
p to display all the email
lists
a to add an entry to a list
d to delete an entry from a
list
l to display a list
f to load lists from file
q to quit:d
Enter name of list to delete from:
Work
Work
0 boss@hotmail.com
1 boss2@gmail.com
Enter entry number to delete:
0
Enter c to create a new list
p to display all the email
lists
a to add an entry to a list
d to delete an entry from a
list
l to display a list
f to load lists from file
q to quit:p
The email lists are:
ExtendedFamily:[cousin1@rogers.com,
cousin2@rogers.com,
cousin3@rogers.com,
cousin4@rogers.com,
cousin5@rogers.com,
cousin6@rogers.com,
cousin7@rogers.com,
cousin8@rogers.com,
cousin9@rogers.com,
cousin10@rogers.com]
NewList:[joe@hotmail.com,
joe2@gmail.com]
Work:[boss2@gmail.com]
Family:[brother@rogers.com,
sister@rogers.com,
mother@rogers.com,
father@rogers.com]
Friends:[mickeyMouse@gmail.com,
donaldDuck@gmail.com]
CST8130Class:[linda.crane@algonquin
college.com, susieSmith@rogers.com,
sallys@gmail.com,
perfectStudent@hotmail.com]
Enter c to create a new list
p to display all the email
lists
a to add an entry to a list
d to delete an entry from a
list
l to display a list
f to load lists from file
q to quit: