Write a client-server program

Assignment Help Computer Engineering
Reference no: EM131210531

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.

Reference no: EM131210531

Questions Cloud

What is difference between microeconomics vs macroeconomics : What is the difference between Microeconomics vs. Macroeconomics? Contrast "monetary policy" from "fiscal policy". Recreate and explain the circular flow model (you may use the whiteboard)
List the pids of parts with the highest cost : How would your answers to the above two questions change, if at all, if your system did not support indexes with multiple-attribute search keys?
Good short-term financial strength : A company has $100,00 in cash, $300,000 in accounts receivable, $50,000 in inventory and a $300,000 office building. Its current liabilities are $250,000. What is the company's current ratio, and does that ratio good short-term financial strength?
What is the sustainable growth rate of output over time : Draw the long- run aggregate supply curves for successive long- run equilibriums with a potential growth rate of real GDP at 2.5 to 3.0 percent per year.
Write a client-server program : 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
Shares of common stock outstanding : Last year Biff industries had an operating profit of $4,800,000, paid $290,000 in interest expense. The applicable income tax rate for the year was 33%. The company had 415,000 shares of common stock outstanding at the end of last year. What wa..
What happens to the price level over successive long runs : Graphically demonstrate how changes in aggregate demand cause inflation or deflation (falling prices) in the short run.
Explain whether the individual is in the labor force : In each of the given cases, explain whether the individual is in the labor force, not in the labor force, employed, or unemployed:
What are the candidate keys for relation g : Is there ever a good reason to accept something less than 3NF when designing a schema for a relational database? Use this example, if necessary adding further constraints, to illustrate your answer.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Flow of email messages from jamborea to your customers

A few of the messages, however, are probably legitimate emails.  Should you do anything to restrict the flow of email messages from Jamborea to your customers?

  Pros and cons of different security techniques

Why is it important for an organization to follow the standard systems acquisition method?pros and cons of different security techniques.

  What interview techniques do companies employ

Watch the "Interview" video found on the student media website. What interview techniques do companies employ? From your experience, have you been in an interview when these were used? Describe the differences and the approach to being successful ..

  Compare the role and impact of a computing technology

information on understanding an inner workings of digital downloads and digital compression. I need to follow the outline below. I'm running out of information. I need to compare the role and impact of a computing technology on society.

  How to construct a permutationgenerator object

note down  a program that produces random permutations of the numbers 1 to 10. To generate a random permutation, you need to fill an array with the numbers 1 to 10 so that no two entries of \array have the same contents.

  Describe how metrics could be used during testing to find

explain how metrics could be used during testing to determine the effectiveness of the testing process and to predict

  Prepare a maintenance plan to install windows updates

The hospital needs to display a HIPPA warning reminding employees of patient confidentiality requirements to all employees when they log on - Several teams need access to local printers which will be shared among the group.

  Design a "clear" button that clears all of the hours worked

make a "Calculate" button to perform the pay calculations for all of the employees.

  Describe how an attacker could use a sniffer in conjunction

describe how an attacker could use a sniffer in conjunction with a trojan to successfully gain access to sensitive

  Why do you think that many parents appear to prefer to use

1. reflect on the parenting style andor model of your own parents or guardians. based on what you observed and what you

  Name six policies you could enable in a windows domain

Name six policies you could enable in a Windows Domain. What is the minimum password length enforced by the Password must meet complexity requirements policy?

  There are many property crimes but onlynbsp4 property

there are many property crimes but onlynbsp4 property crimesnbspare listed by the ucr asnbspindex crimes.these are the

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd