0

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!

nonamer
  • 1
  • 1
  • Just to understand the logic behind. Why would you need something like this? Is this a 'homework' or a 'task'??. Any relation to this: [Volume with Monte Carlo method](http://stackoverflow.com/questions/29055003/volume-with-monte-carlo-method) – Athafoud Mar 15 '16 at 10:37
  • This is a task, related to a project for a game 3D. – nonamer Mar 15 '16 at 10:40
  • Maybe first the most important question. How can I sent to the servlet parameters x,y,z,r in a FURTHER GET requests ? – nonamer Mar 15 '16 at 11:52
  • I would say that servlets and HTTP are immaterial to the problem you're trying to solve. Figure out how to calculate density for a cube with inclusions first; then expose it via HTTP. Take a cube of side length L made of material with theoretical density rho and calculate its total theoretical mass M and volume L^3. Calculate the volume of all inclusions. Since they are empty you can assign them a density of zero. Subtract that missing mass from theoretical total, divide by L^3, and you'll have the adjusted total mass and density. – duffymo Mar 15 '16 at 19:12

0 Answers0