A local pizzeria has acquired the services of your software house to help them with optimal use of their resources. The pizzeria sells slices of pizza, which are triangles take surface area of the triangular box as input and provide maximum volume as output. One additional requirement is that the base of the prism (triangular box) is a right isosceles triangle. To test your code the company has asked you to use 182ππ2 as the surface area.
Sometimes the company knows their volume requirement and thus would want to know the surface area that will result in the desired volume. For this scenario, the company wants you to use the volume obtained from first case as input, the program should thus provide the dimensions and surface area that will result in the required volume; the answer of surface area should be equal to 182ππ2. Furthermore, if the material cost is $5 per unit length, and the budget of the company is $2 million, how many triangular boxes will the company be able to make?
surface area of the triangular box:
"A=a^2+2ah+bh"
where h is thickness of box
a is side of base (cathetus)
b is side of base (hypotenuse)
"b=a\\sqrt2"
"A=a^2+2ah+ah\\sqrt 2=182" cm2
"h=\\frac{182-a^2}{2a+a\\sqrt 2}"
volume of box:
"V=a^2h\/2=\\frac{a^2}{2}\\frac{182-a^2}{2a+a\\sqrt 2}=\\frac{182a-a^3}{4+2\\sqrt 2}"
"V'(a)=\\frac{182-3a^2}{4+2\\sqrt 2}=0"
"a=\\sqrt{182\/3}=7.79" cm
"V_{max}=V(7.79)=138.4" cm3
input:
V
A=a*a+2*a*h+b*h
b=a*sqrt(2)
V=a*a*h/2
output:
a,b,h
A=182
cost of one box:
"182\\cdot5^2=\\$4550"
number of boxes that the company be able to make:
"2000000\/4550=439.56\\approx439" boxes
Comments
Leave a comment