HW 8 Grading Guide
- (30 points)
- (20 points) Test and make sure it works
- The scoreboard is appropriately printed every 2 seconds
- The final queue of contestants is appropriately printed
- (10 points) Your discretion.
- Scan the code and make sure
everything appears in order.
- Pay attention to the TimeKeeper class
and make sure they synchronized the proper methods and did not
synchronize unnecessary methods. Deduct a couple points for being
too aggressive with synchronization.
- (5 point deduction): Make sure that they have a SynchronizedRandom class and that
each contestant uses the same instance of that class. The Race
class should allocate a single instance of the SynchronizedRandom
class, which should then be passed to the constructor for
each Contestant.
- (10 points) 5 points for each part.
Their answer should be consistent with the data structure they used. You can
award partial credit at your discretion.
- (60 points)
- (45 points) Test and make sure it works
- The chat rooms are listed in alphabetical order when a client
connects and the participants in each room are listed in the order
they entered the room.
- You are able to add yourself to a chat room
- If you enter an unlisted chat room, you are continuously
prompted for a chat room until you enter an appropriate one
- When a user enters a chat room, all other users in the chat room
are notified of the arrival.
- Lines from a user are broadcast to all other users in the
chat room.
- When a user leaves the chat room, all other users in the chat room
are notified of the departure.
- When the client quits by sending an EOF character to stdin, the
client should terminate without an exception.
- When the server quits, the user's program should terminate without
an exception when they enter a line of input.
- (15 points) Your discretion. Scan the code and make sure
that it roughly follows the structure I outlined in class.
- The data structure that stores the chat rooms in the server
should be a sorted map because periodically the chat server must
provide a list of chat rooms in alphabetical order. Deduct 2 points
for using a hash table and 4 points for using a list.
- A main chat server that loops, accepts client connections, and
forks server threads to handle each client.
- A server thread for each client that receives input and forwards
the information to a chat room object.
- A chat room object that distributes messages to individuals in
the chat rooms. There should be one chat room object per chat room.
Having one chat room object for the entire application could result
in unnecessary client blocking if two server threads from different chat
rooms try to get to the chat room object simultaneously.
- A client-side program that connects to the server and
handles reading from stdin and the socket in an appropriate
fashion (probably with the main thread dealing with one of the
input streams and a second thread dealing with the other input
stream).