Question: Write a server for a client. The client sends the weight and height for a person to the server (see Figure 31.18a). The server computes
Write a server for a client. The client sends the weight and height for a person to the server (see Figure 31.18a). The server computes BMI (Body Mass Index) and sends back to the client a string that reports the BMI (see Figure 31.18b). See Section 3.8 for computing BMI. Name the client Exercise31_02Client and the server Exercise31_02Server.
Exercise31_02Server EExercise31_02Client Weight in pounds Exercise31_02Server started at Sun Sep 15 12:10:05 EDT 2013 Connected to a client at Sun Sep 15 12:10:37 EDT 2013 Weight: 134.5 Height: 72.0 BMI is 18.24. Underweight 134.5 Height in inches Submit 72 Weight: 134.5 Height: 72.0 BMI is 18.24. Underweight (a) (b)
Step by Step Solution
3.43 Rating (166 Votes )
There are 3 Steps involved in it
Program Plan Create a class BMIServer which extends Application and override the start method Define the start method to display the GUI as shown in the textbook Thread will start the server by creati... View full answer
Get step-by-step solutions from verified subject matter experts
