Hi, Need help for lab in python 3.4.2 Thank You Instructions : The program shall
ID: 638676 • Letter: H
Question
Hi, Need help for lab in python 3.4.2 Thank You
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 ?
Sample run, Minimal version
the user input is shown in blue bold text.
Fish ponds are available in the following shapes:
circle, square, rectangle, oval, L
Please select the shape for your fish pond: square
The volume of your fish pond is 50.000 cubic feet.
The surface area of your fish pond is 65.000 square feet.
The volume is determined by the area of the base times the depth. In this case, the square base has area 25, 5x5, and the depth is 2 feet. So, 50 cubic feet, printed with three places after the decimal point.
The surface area is actually just the area of the sides and bottom of the pond. There are four sides, each 5x2, for the area of the sides of 40 square feet. As noted above, the area of the bottom is 25 square feet. This gives a total surface area of 65 square feet, also reported with three places following the decimal point.
The surface area is actually just the area of the sides and bottom of the pond. There is one circular side, 5? ? 2. So, the area of the sides is approximately 31.415927 square feet. As noted above, the area of the bottom is approximately 19.634954 square feet. This gives a total surface area of approximately 51.050881 square feet, also reported with three places following the decimal point.
Notes for Minimal Versions
The script shall prompt the user for the shape of the desired fish pond.
The prompt for the shape shall include the acceptable values: circle, square, rectangle, oval, and L.
The script shall only process a single fish pond. After the one pond is done, the script shall end.
The calculated values shall all be reported to the thousandths, three places after the decimal point.
For the minimal version, the values for the volume and surface area can be hard-coded into the output string.
Report
In addition to the Python script, the assignment includes a brief written report that answers the following questions:
How did you approach (get started with) this assignment?
How did you test your program?
What works and what doesn't work?
What did you learn from this assignment? What would you do differently next time?
Notes about the Report
The written report does not have to be long. A paragraph or two is probably sufficient for this assignment.
The file format for written report is ASCII text (.txt file). As a plain text file, you don't have to worry about issues like bold, italics, images. It should make it simpler.
You may find it easier to write the written report if you start it early and take notes about the process as you work through the problem, rather than trying to write the report at the end, from memory.
The final question: "What would you do differently next time?" is asking about how you would approach the next programming assignment based on what you learned in this assignment. It is not about this specific programming problem.
Put your name and this assignment number and name at the top of the written report.
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.")
elif (shape == "oval"):
print ("The volume of your fish pond is %.3f" % ((2*4 + 3.14159*2*2)*(d/12))+(" cubic feet."))
print ("The surface area of your fish pond is %.3f" % ((2*4 + 3.14159*2*2) + (2*3.14159*2*(d/12)) + (4*(d/12))) + " square feet.")
else:
print ("The volume of your fish pond is %.3f" % ((10*3 + 5*3)*(d/12))+(" cubic feet."))
print ("The surface area of your fish pond is %.3f" % ((10*3 + 5*3) + 20*(d/12) + 12*(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.