Write a socket program to implement the numberguessing game. Server randomly gen
ID: 3615558 • Letter: W
Question
Write a socket program to implement the numberguessing game.Server randomly generates a number between 0 to 9 and give client 3chances to guess the number correctly. For a number sent by Client,Server tells Client whether the number is greater than, equal to,or smaller than the number to guess. When Client successfullyguesses the number, Server congratulates Client, otherwise Serversends a failure message to Client.
The following is an example of a session:
Server generates random number 7.
Client connects to Server
Server sends greeting message "You have three chances to guess anumber from 0-9"
Client sends "5" to Server
Server replies "greater"
Client sends "8"
Server replies "smaller"
Client sends "7"
Server replies "congratulations!"
Explanation / Answer
x.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.