Write a simulation of a chatting software. You're gonna need 4 classes:

Main: To set the whole thing up.

Server: Used to relay messages from ClientA to ClientB, and from ClientB to ClientA.

Clients A & B: These clients should have a two way pipe with the server. Both clients should send letters/words to the server at random time intervals, but should constantly read from the pipe in case they have received a message. Any messages that are sent/received should be printed on the screen. So for eg, the output will look something like this:

At *some date/time* Client A said: Blah!
At *some date/time* Client B received: Blah!
At *some date/time* Client A said: Oh no!
At *some date/time* Client B received: Oh no!
At *some date/time* Client B said: How's it going, eh?
At *some date/time* Client A received: How's it going, eh?

Do not have the clients chatting with each other directly. Have client A and B connect to servers through pipes. In the server, create two more pipes. One to link the output of A to the input of B and vice versa.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.