Question: Question one: - You must build a client server application that have two client and one server, all client connect at port 3333. - The
Question one:
- You must build a client server application that have two client and one server, all client connect at port 3333.
- The program should apply stone-paper and scissors game , the server ask each client his choice then the clients will send his choice to the server and the server will decide who the winner depend on the following rules:
If one of them choice the scissors and another choice paper, the scissors is winner.
If one of them choice the Stone and another choice paper, The Stone is a winner.
If one of them choice the scissors and another choice Stone, The Stone is a winner.
- You must let each client the result, if both select the same .you must let the clients know and try again until one of them win.
Question two:
Consider a system connected as shown in the figure below.
1. System S1 generates a random number (R1) between 0 and 10 and sends it to S2.
2. System S2 generates a random number (R2) between 0 and 10 and sends the value R1+R2 to S3.
3. System S3 generates a random number (R3) between 0 and 10 and sends the value R1+R2+R3 to S4
4. System S4 generates a random number (R4) between 0 and 10 and sends the value R1+R2+R3 to S1
5. If the value received by S1 is less than 30 and more than 25 then stop the system as follows
a. S1 sends the word stop to S2.
b. S2 send the word stop to S3 and closes all sockets and I/O ports and
c. S3 send the word stop to S4 and closes all sockets and I/O ports and
d. S4 send the word stop to S1 and closes all sockets and I/O ports and
Faculty of Computer Information Technology
Software Engineering Department
Client Server System (SE371)
Midterm Exam, Tuesday 29 December
e. S1 closes all sockets and IO ports
f. S1 prints the final value received at S1 (R1+R2+R3+R4)
g. S1 prints the number of times the process was repeated
6. If the value received by S1 is more than 30 or less than 25 then repeat the process starting at point 1 above.
use java
R1 R2 R1 $1 S2 Complete the cycle Compute X R1+R2 R3+R4 R1+R2+R3-R4 R1-R2 Yes NO 25
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
