Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve this with java :) In this assignment, you are required to write two classes: one that represents a UDP server and the other

Please solve this with java :)

image text in transcribed In this assignment, you are required to write two classes: one that represents a UDP server and the other represents a UDP client. The operation of the program can be concluded in the client sending double values to the server, and the server returning either the average or the maximum value of the sent numbers based on the client request as follows: 1. The client program must read the operation to be performed, either computing the average or finding the maximum value, from the user. Then, the program must read double values from the user, until the user enters -1 (positive double values are only assumed to be entered). Make sure you prompt the user to enter what is required with appropriate messages. The client program must then send the operation to be performed then the double values to the server and wait for the server response. When the response is received, it must print the returned value in an appropriate message to the console (e.g. Average of your numbers is .... Or Maximum value is .....) 2. The server must bind to port number 7500 and keep on waiting for requests (packets) to be received from clients. The client packet must include what operation to be performed along with the double values. The server program must compute the value based on the required operation and send it back to the client. In addition, the server must print details of the received packet and numbers to the console as follows: date-time client-ip:client-port\#double_numbers(space separated) - Average_or_Max =.. You can use the loopback address for testing vour application

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