The primary goal of this lab is to write, test and complete a program with multiple classes, where
you have designed and implemented those classes. You will also code and use methods and attributes. This program will have an interactive behavior. This will reinforce the need for good
design and creating and using new classes.
The lab will build a rudimentary chat system to reinforce the concept of communication between
1. Design a Person class.
2. Instantiates an object from a class you design (class Person).
3. Stores the data in your Person class.
4. Design a Chatroom class.
5. Integrate multiple Person objects into the Chatroom object.
6. Carry out a conversation between multiple people by inputting data and posting it to the
console of the Chatroom object.
The class you create will be a Person class. The Person class will connect to Chatroom. The
Chatroom object will allow multiple Person objects to communicate to each other. The class
will contain the following list of data attributes. You must decide the correct types for each, and
minimally use the attributes and methods listed below.
• First Name
• Middle Initial
• Last Name
You will need to code a get and set function for each attribute, so minimally 2 methods per each
attribute. You can design more if you want. The required methods are below:
• public void sendMessage(String message)
• public String receiveMessage()
• public void sendQuestion(String question)
• public String receiveQuestion()
• CurrentPerson – the current person sending a message
• CurrentMessage – the current message being sent/answered
• CurrentQuestion – the current question being sent/answered
You will first instantiate several persons into the Chatroom object. Then, go through a continuous
series of interactions (loop) where the you will ask what person, by Last Name, wants to send
a message/question. Then the system will ask what Person object to send the message/question
to. Third, it will ask if you want to send a message or question. Finally, the text of question or
message will be entered. once it is entered, the system will do 2 operations. Update that question or
message into the memory of the person object to which it was intended. Second, display a message
to the screen showing what message has been sent from who to who, whether it is a question or
message and what is the content of the text. This will continue until the user exits with an ”END”
command as the message.
Please begin the chat!
Sender Name: Matson
Receiver Name: Smith
Question or Message: question
Text: What time is lunch?
Matson asked Smith, “What time is lunch?”
Please begin the chat!
Sender Name: Smith
Receiver Name: Matson
Question or Message: message
Text: Lunch is at noon.
Smith said to Matson, “Lunch is at noon.”
Submit the project file(s) to Blackboard by the required date and time. The grading will be done
in lab, but the documents must be submitted to Blackboard as a backup.