This is a multi-part homework that extends over several weeks. Put all work into a directory hw2
of your Git project and push it each week.
Remember to run git commit
at least once a day to get full points.
We want to implement a text messaging system that is somewhat similar to the voice mail system in the textbook. Here is a typical user interaction (inputs in bold):
Welcome to TextChat. [L]ogin [N]ew user [Q]uit: N Select a user name: fred Select a password: secret User added. Welcome to TextChat. [L]ogin [N]ew user [Q]uit: L User name: fred Password: secret Welcome fred. [S]end message [R]ead messages [L]ogout: S To: mary Message text, . to end: Hi Mary, what's up? Etc. Etc. . Message sent. [S]end message [R]ead messages [L]ogout: R From: mary Hi Fred, what a surprise. Etc. Etc. [K]eep [E]rase K [N]ext [D]one with messages D [S]end message [R]ead messages [L]ogout: L Welcome to TextChat. [L]ogin [N]ew user [Q]uit:
Provide the following in the hw2
directory:
Message
, Mailbox
, MessageQueue
, MailSystem
like in the textbook. But does the Mailbox
have a user name and password? Shouldn't that be a User
? And there is no Telephone
. Instead, use a class Console
for interfacing with the user. Provide CRC cards for classes Mailbox
, MailSystem
, and Console
. Write them out on real index cards and take a photo. Save it as crc.jpg
.crc.txt
in which you explain, for each collaborator, why it is a collaborator. What is an object of the class going to ask the collaborating object to do, and when?uml.png
uml.txt
in which you explain, for each association and dependency, why an object of one class has, or uses, an object of the other.Console
, Mailbox
, MailSystem
, MailSystemTester
, Message
, MessageQueue
, User
. Put all classes in the default package.hw2
repo. (The same one that you used last time.)cd hw2 javac *.java java MailSystemTester < input.txt > output.txt diff output.txt expected.txtHere is a sample
input.txt
and expected.txt
.input2.txt
and expected2.txt
input3.txt
and expected3.txt
input4.txt
and expected4.txt
input5.txt
and expected5.txt
input6.txt
and expected6.txt
hw2b.txt
in which you explain all of the parts of your implementation that ended up being different or nonexistent in your homework 2A design. Do not update your homework 2A design documents.sequence.png
.