I am using JavaEE and Servlets. I have a problem with understanding and making one class in my project. If anyone is able to give me some tips how can I do it, how should I start do it or give me some examples I will be very grateful.
I need to create (using Servlets), the component named Cube
. Servlet input is defined by 3 parameters: a - determines the length of the side
cube located at the origin (resulting from the scaling unit cube by a) expressed in meters [m]. Cube is made of a material having a specific density, c expressed in [kg] / [m3].
The material defects are present which are of the spherical shape and density of the material g.
The results of the test material structure containing a description of the defects - each of which is stored in the form of a sphere with center equation
at the point (x, y, z) and the radius r are sent to the servlet in a further GET
requests.
The order of the parameters x, y, z and y in the request (Url) is arbitrary.
Receiving the request POST
parameters: a - determines the length of the side of the ankle, c - characterized by material density
the cube was made and g - characterizing the density of the material in the areas of defects means that the transferred data set.
Receipt by the servlet request POST
marks the transition to the phase of data analysis and determination of the result. POST
request http
shall refer determined by the actual weight of the component of the analyzed block of material. To solve the task used to be
Monte Carlo method, wherein the result should be determined to an accuracy of no less than 10^(-2).
The program is to be stored only in a single file containing the code of the servlet Cube.java
implementing mechanism
the search for solutions. The program can not use any external libraries.
The result of the program should be well rounded and formatted number with a value equal to the sought bulk solids - no
formatting and return complete html pages.
Thanks in advance!