首页 > > 详细

辅导Canvas site、java程序语言调试、java讲解、辅导multiple clients辅导R语言程序|讲解Java程序

Assignment #3 Part A
Due 5:00PM November 11 (Monday) 2019
How to turn in Assignment #3 Part A: Save the Java source code for the server in a file named assign3Server.java .  Log into Canvas. In the Canvas site for this course, click Assignments and then click the link assign3a and upload the file assign3Server.java . The file must be submitted by uploading the file in Canvas.
Be sure to include your full name as a comment at the beginning of the source file.
This assignment is essentially an exercise on wrinting a server that guesses a number in 1..1000 that a client chooses. The server must be able to serve multiple clients simultaneously.
Overall, a client is to choose a number in the range 1..1000 without telling the server the chosen number. Then the server and the client will engage in a dialog through which the server will find the chosen number by making no more than ten "educated guesses". You should write the server and then test the server with telnet, which connects to the server running on the local machine by the command telnet 127.0.0.1 4192  As an example of servicing a single client, click here to see the server window and click here to see the telnet window. In this example, the user chose the number 419  (but the server does not know that). In the telnet window, the text in red is text entered by the user, and the text in blue is text sent by the server to telnet (the client).  The server is able to detect a cheating user. For example, if the user cheats by answering L when the server guesses 419, the telnet window will be this but the server window will remain this. Note that in the server window, the text ***Starting a dialog with Joe was displayed only after the user  enters the name Joe in the telnet window. It should be obvious that the algorithm that the server uses to guess the number is similar to binary search. If such an algorithm fails, it can be inferred that that user changes his mind at some point during the dialog (that is, the user cheats).  The server also detects incorrect response (a response that is not C, not H and not L) from a client. As an example of an incorrect client response, click here to see the server window and here to see the client window.
The server can handle multiple clients concurrently. As an example of the server servicing two telnet clients concurrently, click here to see the server window, and click here and here to see the telnet client windows. In the example, Joe's chosen number is 419 and Tom's is 221. As shown in the server window, Tom's diaglog begins after Joe's and ends before Joe's. This implies that the two dialogs  proceeded concurrently. On the other hand, if Tom's dialog ends after Joe's, the then server widnow will be this, which shows that the two dialogs only partially overlap in time.
The user interface of your server to a client must be identical to that shown in the examples.
Do not use any package statement in your Java code  (i.e., your Java program will belong to the default package). Your source file must NOT depend on any IDE ( integrated development environment) to compile or to run. Your source file will be tested in the command-line environment.
 
 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!