Write a Java program to answer the following item. Create a multi-threaded program that will act as a server named Multi
Posted: Thu May 05, 2022 1:08 pm
Write a Java program to answer the following item. Create a multi-threaded program that will act as a server named MultiThreadedServerBMI (server) to process multiple simultaneous service requests in parallel. MultiThreadedServerBMI (server) listens for a client socket connection and executes the Server ThreadBMI thread class. The Server ThreadBMI includes a method that calculates the Body Mass Index (BMI) based on the given value of weight (kg) and height (m) from the user and determines the equivalent BMI range. In determining the BMI range, the computed value must be categorized with the following: BMI Range Category Underweight < 18.5 Normal 18.5 to 25 Overweight 25-30 Obese > 30 The formula for calculating the BMI in metric units is: BMI = weight in kg/(height in m * height in m) Create a program that will act as a client program named ClientBMI. Prompt the user to ask if they want to determine the BMI by entering 1 or 2 to exit the program. If the user enters 1 then prompt the user for the value of height (m) and weight (kg). The response of the user, heigh, and width will be sent to the server to determine the equivalent category of the computed BMI value and respond to the connected client programs. After the response of the server, the client program will prompt again the user if they want to determine the BMI by entering 1 or 2 to exit the program. If the user enters 2 then terminate the method at the server program and client program.