Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question 1 -

Write a client-server program. The server has the following properties:

  • It wait for requests at port 12345.
  • It will create a thread to serve one incoming request.
  • In each request, an integer is sent from the client. Then, the server will send back the average of all the numbers that have been sent to the server. The average should be of type double.
  • Since the server is multithreaded, make sure that your system is thread safe.
  • You should also write a client so that the user can send in a number and display the current average.

The client should look like this:

2152_Figure.png

The first text field is used to set the IP address of the server. The second text field is used to input an integer. The connection is created when the button is pressed. The bottom line shows the current average held by the server.

Question 2 -

Rewrite question 1 as a Web service. The client should look the same as that in question 1.

Please note that the host field in the client should have no use as the client is tied to a server when you wrote the client. Therefore the client is not free to choose the server. So in the client, you just ignore the contents in the Host field.

Question 3 -

Rewrite the server of question 1 but use a database to store the information from clients instead of attributes.  For example, you may have attributes in your answer to question 1 to store the total sum of integers and number of requests so far.  However, in this question, you should use a database to store them.

In your answer, in addition to the Java program code, you should also give the SQL statements to create your database.

You do not need to rewrite the client in Question 1.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91966535

Have any Question?


Related Questions in Computer Engineering

Identify and evaluate at least three considerations that

Identify and evaluate at least three considerations that one must plan for when designing a database. Suggest at least two types of databases that would be useful for small businesses, two types for regional level organi ...

What is 4g and its benefits how fast is your internet

What is 4G and its benefits. How fast is your Internet service supposed to be for stationary users?

Once considered pure science fiction artificial

Once considered pure science fiction, artificial intelligence (AI) is being relied on more and more in today's world. Artificial intelligence deals with algorithms based on complex data sets. If you had to tell story rep ...

Recall that a floating-point number can be expressed as-1s

Recall that a floating-point number can be expressed as (-1) s (1 + f) 2 e where s, f and e are binary numbers. Recall that s is the sign indicator, f the mantissa (or fractional part), and e the exponent. Suppose the si ...

Suppose that a data warehouse consists of the four

Suppose that a data warehouse consists of the four dimensions date, spectator, location, and game, and the two measures count and charge, where charge is the fare that a spectator pays when watching a game on a given dat ...

What is a security policy and why is it so critical to the

What is a security policy and why is it so critical to the success of an organization's information security program? Select an Issue Specific Security Policy and describe why an organization should have this issue cover ...

Research the history of specification languages and write a

Research the history of specification languages, and write a report on the successes or failures of some of these languages. Include 5 languages which are successful and 5 which have failed. All work should be typed writ ...

Q1 state whether the following is true or false and why1

Q1. State whether the following is true or false and why: (1) Monopolists can charge whatever price they want and maximize profit since they are price makers.  T/F: Why? (2) A firm that has a monopoly on a certain good m ...

Given two eventsnbspgnbspandnbsph the probabilities of

Given two events  G  and  H , the probabilities of each occurring are as follows: P( G ) = 0.22; P( H ) = 0.34; P( H  AND  G ) = 0.09. Using this information: Find the complement of P ( H  AND  G ). Round to 2 places.

Question 1 in each of the following scenarios there is a

Question: 1. In each of the following scenarios there is a relationship to work life in the IT industry. With each of the following question, ensure that your answer includes the explanation of how it would be applied to ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As