Question: This can be coded in Python. Simple Calculation Services via Network In this project, you are required to implement a network application, which consists of

This can be coded in Python.

This can be coded in Python. Simple Calculation Services via Network In

Simple Calculation Services via Network In this project, you are required to implement a network application, which consists of a server and one or more clients. The server will provide simple calculation services to the client(s). You should use both UDP sockets and TCP sockets to implement the communications between the server and the client(s) Behavior on the client side: The client program should be able to run in a forever while loop, so that the user can send as many calculation requests as he/she wants. The client can input a math expression that it wants to calculate, such as "50 + 100", 50 * 100" etc In each iteration of the while loop, the client program should provide two choices for the user: 1.) terminate the program, indicating that the user no longer needs to do any calculation this time 2.) continue to input math expressions. This is like providing a menu for the user. You don't need to design Graphic User Interface (GUI). The client program can just print out some instructions for the user, and determine what the user wants according to the user's input. The math expression is input as a string. You need to send the calculation request to the Simple Calculator Server using UDP socket and TCP socket. In this aspect, the message sending process is very similar to the example application we discussed in class. If the user explicitly indicates that he/she wants to exit the program, the program should properly close any socket previously used for communications. 1. 2. 3. 4. 5. Behavior on the server side: 1. The server should have a while loop that can continuously accept calculation requests. 2. Server should understand at least the four operators, i.e., +, -, *, and /, when they appear alone Expressions are received as strings. Example expressions: "40 50", "20 - 100", "10* 20", "100/ 1000". It should be flexible enough such that if the expressions are reasonable, they should be considered valid and accepted. For example, these expressions: "40+50 ", "40 + 50 " and "40+50", are all valid and should be accepted. That is, adding or removing arbitrary spaces anywhere in the expression shouldn't be a problem The result of a calculation request will be sent back to the corresponding requester as a string, which represents a number The server should be able to serve multiple clients, at least one client by one client. 3. 4. Simple Calculation Services via Network In this project, you are required to implement a network application, which consists of a server and one or more clients. The server will provide simple calculation services to the client(s). You should use both UDP sockets and TCP sockets to implement the communications between the server and the client(s) Behavior on the client side: The client program should be able to run in a forever while loop, so that the user can send as many calculation requests as he/she wants. The client can input a math expression that it wants to calculate, such as "50 + 100", 50 * 100" etc In each iteration of the while loop, the client program should provide two choices for the user: 1.) terminate the program, indicating that the user no longer needs to do any calculation this time 2.) continue to input math expressions. This is like providing a menu for the user. You don't need to design Graphic User Interface (GUI). The client program can just print out some instructions for the user, and determine what the user wants according to the user's input. The math expression is input as a string. You need to send the calculation request to the Simple Calculator Server using UDP socket and TCP socket. In this aspect, the message sending process is very similar to the example application we discussed in class. If the user explicitly indicates that he/she wants to exit the program, the program should properly close any socket previously used for communications. 1. 2. 3. 4. 5. Behavior on the server side: 1. The server should have a while loop that can continuously accept calculation requests. 2. Server should understand at least the four operators, i.e., +, -, *, and /, when they appear alone Expressions are received as strings. Example expressions: "40 50", "20 - 100", "10* 20", "100/ 1000". It should be flexible enough such that if the expressions are reasonable, they should be considered valid and accepted. For example, these expressions: "40+50 ", "40 + 50 " and "40+50", are all valid and should be accepted. That is, adding or removing arbitrary spaces anywhere in the expression shouldn't be a problem The result of a calculation request will be sent back to the corresponding requester as a string, which represents a number The server should be able to serve multiple clients, at least one client by one client. 3. 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!