In this programming assignment, you will implement a client process on eustis.eecs.ucf.edu and a server process on eustis2.eecs.ucf.edu, respectively, to communicate with each other. If you never SSH login to eustis and eustis2 machines, your account should has the usual NID as your username and default password (Pyymmdd) with your birth year, month and day. If your computer is out of campus network, you need to first VPN to UCF then connect to Eustis machines.

You can use either C, C++, or Java, or Python to program this project. Eustis and eustis2 servers support all these programming languages.

Your client program and server program should operate as follows. Your server runs first on eustis2 machine waiting for your client to connect. The server should use a server port number choosing by yourself and must be bigger than 1024 (smaller than 65535). Your client runs next on Eustis machine.

Objective---Simple math calculator: The client program repeatedly requires the user to input a basic math computing question, which will be sent to server program where it will be computed. The result is sent back by the server program and the client program displays it out.

Math computing question has this format: x op y =, where x and y are positive real numbers, op represents math operator of +, -, *, / . The user ends the repeated input procedure by typing 0/0=. If the user types in an invalid math question, the client should show an error message Input error. Re-type the math question again.

The server should output the math questions sent by the client, and show the end of client input when receiving 0/0=, and then shut down. An example interaction between the client and the server is shown below (red colored text are user input parts):

Client Side:
Connected with server on [IP address]
20 + 10.5 =
Answer from server: 30.5
13 / 4 =
Answer from server: 3.25
0 / 0 =
User input ends; end the client program
Server Side:
Connected by client on [IP address]
Received question “20 + 10.5 =”; send back answer 30.5
Received question “13 / 4 =”; send back answer 3.25
Received question “0 / 0 =”; end the server program

When you submit this assignment to me, please submit the following (put in a .zip file):

  • A brief report: write a brief description of your program codes, then copy the screen output images in your report, showing your client running screen and server running screen (must be screen shot images, not the text you directly copy and paste onto your report). Your client and server interaction must show each of those four types of math operations at least once.
  • Submit client source code and server source code as attachments in the webcourse submission page. The TA will try to download and run your code by himself. Be sure to explain clearly in your report how to compile and run your code!
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.