Hi, Need help for lab in python 3.4.2 Thank You Calculates the dimensions for va
ID: 638675 • Letter: H
Question
Hi, Need help for lab in python 3.4.2 Thank You
Calculates the dimensions for various fish pond configurations. Specifically, the program will calculate the volume for the pond in cubic feet, the surface area of the sides and bottom of the fish pond, and the area of a 2-foot wide border around the edge of the pond.
Ponds come in predefined sizes and shapes.
There are:
- circular ponds, diameter: 5 feet
- square ponds, side: 5 feet
- rectangular ponds, dimensions: 4 feet by 7 feet
- ovoid ponds, dimensions: 4 feet by 6 feet
The "oval" can be decomposed into two semicircles attached to a rectangle.
- "L"-shaped ponds: overall dimensions: 6 feet by 10 feet
The "L" can be decomposed into three smaller rectangles; alternately, it could be viewed as a large rectangle with a corner excised.
The basic depth of a pond is 24 inches. For the Challenge option, depth is variable: 18, 24, or 30 inches deep. Remember that 12 inches is one foot, so these values translate into 1.5, 2.0, or 2.5 feet deep, respectively.
Instructions:
The program shall ask the user for the characteristics of the desired fish pond:
the shape: circle, square, rectangle, oval, or L
the depth (for the challenge option): 18, 24, 30
The only acceptable input values are those listed in bold above.
Based on the user's input values, the program shall calculate and report the statistics for the requested pond:
the volume in cubic feet
the surface area of the sides and bottom
the surface area for a two-foot wide border around the pond
Minimal version
For the minimal version, the program can assume that the user always types accurately. So, if the user does not enter one of the expected values, the behavior of the program is undefined. That is, it could crash, it could end without generating any output, it could
Explanation / Answer
print ("Fish ponds are available in the following shapes: circle, square, rectangle, oval, L")
print ("Please select the shape for your fish pond: ",end=" ")
shape = input();
print ("the depth (for the challenge option): 18, 24, 30",end=" ")
d = float(input())
if (shape == "circle"):
print ("The volume of your fish pond is %.3f" % (3.14159*2.5*2.5*(d/12))+(" cubic feet."))
print ("The surface area of your fish pond is %.3f" % (3.14159*2.5*2.5 + (2*3.14159*2.5*(d/12))) + " square feet.")
elif (shape == "square"):
print ("The volume of your fish pond is %.3f" % (5*5*(d/12))+(" cubic feet."))
print ("The surface area of your fish pond is %.3f" % (25 + (4*5*(d/12))) + " square feet.")
elif (shape == "rectangle"):
print ("The volume of your fish pond is %.3f" % (7*4*(d/12))+(" cubic feet."))
print ("The surface area of your fish pond is %.3f" % (28 + (22*(d/12))) + " square feet.")
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.