Question: Hw1 Socket Programming Problem You will write a simple application that requires a server to try and guess a number random Integer generated by a
Hw1 Socket Programming Problem You will write a simple application that requires a server to try and guess a number random Integer generated by a client. The client will send the maximum possible value and the number of guesses to the server. The server will then try to iteratively guess the number based on feedback from the client. Note: In most cases the server will have less than logan guesses. Your grade will not be based on whether you do any clever Al on your server. Protocol: The client will connect with the server and send two integer values with consecutive writelnt() calls. The first value will be the maximum value and the second value will be the number of guesses. The server will make a guess at the value and send the guess back to the client. The client will output the guess made by the server and respond to the server with the integer -1 (the guess was too low), 1 (the guess was too high) and the guess was correct. This process continues until the guess is correct or the maximum guesses is reached. After the client sends the last response to the server, the client outputs the secret number and if the number was guessed. You should pass the maximum value, the number of guesses, server IP and server port as command line arguments to the client. Deliverables: Upload your documented Client.java and Server java source files. Each should have its own main() method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
