Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are required to build a client server system, utilizing the concept of threads. The proposed system is a voting system described as follows. The

You are required to build a client server system, utilizing the concept of threads.
The proposed system is a voting system described as follows.
The voting system has a multi-threaded Server and multi-threaded clients.
The server has a total of 2 threads, which receive and count the number of votes for the candidates
The number of voting people =1000.
The system works as follows:
1- The system has 5 candidates (C1, C2, C3, C4, C5) and 1000 voters (V1, V2,...{1000).
2- The voters use 10 voting stations. (Must use threads. Do not create 10 clients)
3- Two servers are used to serve the voting process (Must use threads. Do not create 2 servers)
4- Example:
a. Voter Thread (i): generates a vote for one of the 5 candidates.
b. The voter selects the candidate randomly.
c. After each vote, the voting station (thread) waits (delay) for X milliseconds. X is a random number between 5 and 10 milliseconds.
d. The voting process stops when the number of total votes received by the server is 1000.
e. The server must inform the voting station threads to stop generating votes and close.
f. The server shall print the number of votes received by each candidate.
g. Your output should be formatted as follows
//Total time of voting
//Number of votes received by candidates
Candidate Name Number of Vote
========================
C1 Number
C2 Number
C3 Number
C4 Number
C5 Number ?
?solve this quation in java (as a client server)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

What methods do communication scholars use to conduct research?

Answered: 1 week ago