Question: 223 Advanced Java Object-Oriented Programming Week 8 Assignment We would like to write a TCP/IP based Java client/server program that is used to compute basic
223 Advanced Java Object-Oriented Programming Week 8 Assignment We would like to write a TCP/IP based Java client/server program that is used to compute basic mathematical operations (+ / and%). Client side: 1. Write the client program that create a socket to the server. We will use port 3000. And then it creates the input and output stream 2. The client reads two numbers from the user, then the operator, and finally, it sends them to the server. 3. The client waits for the answer from the server and print it on the screen. 4. The client asks the user if he wants to retry. If so, go to I (first step). Else, it sends the message"bye" to the server and ends the program Server side: 1. Write the server program that create a socketServer to listen if there are new requests from clients on the port 3000. If the server receives a client request, it creates a socket to start communicating with the client. The server has to be multi-threaded, so it can communicate with more than one client at a time. 2. For a given connected client. the server wait to receive two numbers from the client and one string containing the mathematical operator. 3. The server makes the computation and send back the result to the server, 4. If the server receive the message "by", it will end the communication with that client and finish the corresponding thread 223 Advanced Java Object-Oriented Programming Week 8 Assignment 1/1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
