Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Instructions: Compile the C programs in one of the CSE (cse01 cse06) servers and make sure its working. Comment your code. Create a Makefile and

Instructions:

Compile the C programs in one of the CSE (cse01 cse06) servers and make sure its working. Comment your code. Create a Makefile and a readme file that describes the working and usage of the code. Please create a zip archive of your assignment folder (Makefile, readme, code, and header files) and upload the zip file. Not following the above instructions could result up to 50% deduction from your assignment score. Late submissions are not allowed.

Objective:

Create a UDP math server that can compute simple math numerical expressions that is requested by a UDP client.

Requirements:

1. Create a C-based client-server architecture using a UDP sockets

2. The UDP math server should run on cse01.cse.unt.edu machine and the client can run on any cse machines. The math server should be able to compute simple numerical expression with at most four operations and integer operands

3. The math server should be able to perform ten operations: addition, subtraction, multiplication, division, square root, power (xy), exponential (ex ), sine of a radian angle, cosine of a radian angle, and log

4. The numerical expression should be evaluated with or without spaces between operations and operands

5. The numerical expression with nested parentheses or nested expressions are considered as invalid expressions

6. The results should have at least four places of precision

7. The math server should be able to quit computation when a quit expression is given as input

8. The math server should parse the input expression and identify the operands and operations and perform the computation

9. Do not use functions for expression evaluations or use any Linux shell commands or code from the internet

10. The C implementation can take advantage of pre-defined functions for square root, power (xy), exponential (ex ), sine, cosine, log computations, and for string manipulations.

Procedure:

1. Test the C-based UDP server and client given on Blackboard and create the UDP math server

2. Make sure the math server runs on cse01.cse.unt.edu and the format to start the math server is as follows mserver where mserver is the math server executable and port_number is the port number on which the math server listens

3. Create a C-based UDP client that can connect to the UDP math server using UDP sockets

4. The UDP client can run on any cse (cse02 cse06) machines and the user can issue the numerical expression as shown below client exprsn:(5+6)*(6+5) where client is the client executable, port_number is the port number on which the client connects the server and exprsn is the requested numerical expression

5. Once the math server gets a request from the client, it computes the value of the expression and replies it to the client

6. The math server quits computation when a quit expression is given as input

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions