Question

Calculates thedimensions for various fish pond configurations. Specifically, theprogram will calculate the volume for...

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.

There are two enhancements for the Standard version over the Minimal version:

  • The program will perform the calculations within the script file.

  • Reported the area of a two-foot wide border around the pond.

The program will still assume that the user input is accurate. If unexpected values are entered, the behavior of the script is "undefined".

Program-Internal Calculations

For the Minimal version, you could calculate the values for the volume and surface area external to the Python script and just print out the numbers. For the Standard and Challenge versions,all of the calculations must be present within the Python script.

  • The script shall calculate the values based on the dimensions given above and the user's input. That is, the script needs to calculate the volume and area, rather than just output precalculated values.

  • The script shall use math.pi for the value of π, rather than some other approximation.
    Note: To use the value math.pi, your script file will need to include the following declaration toward the top of the script, after the header comment: import math

The values can be used for the shapes are the ones that appear on the schematic diagrams of the shapes. They are repeated in the table below.

ShapeGiven Values
circle5
square5
rectangle4, 7
oval4, 6
L3, 6, 5, 10

Let's see how this would work. As an example, here are the calculations for a circular pond of the standard depth, 24 inches.

The base of the pond is a circle, 5 feet in diameter. So, the radius is 5/2 or 2.5 feet.
The area of the base is the area of the circle, π ·r2.
The perimeter of the base is the circumference of the circle, 2π ·r.
The depth is 24 inches, or 2 feet.
So, the volume is the area of the base times the depth.
The surface area is the area of the base plus the area of the sides.
The area of the sides is the depth times the perimeter of the base.

Converting this into Python is pretty straight forward:

r = 5 / 2
base_area = math.pi * r ** 2
base_perim = 2 * math.pi * r
depth = 2.0
side_area = depth * base_perim
volume = base_area * depth
surface_area = base_area + side_area

Note: we get the 5 because the user selectedcircle. That selection also gives us the formulae for area and perimeter of the base. The depth is derived from the input depth value of 24 inches. This could be either calculated or just use the correspondences in the following table.

InchesFeet
181.5
242.0
302.5

Border

For the Standard version, the program shall calculate the area of a two-foot wide border around the pond. This calculation should also occur within the Python script. The mathematics of calculating the area of the path is left as an exercise for the student. They can be calculated using simple plane geometric figures.
Hint: It's probably easiest to calculate the border by subtracting the top of the pond from a larger solid.


Sample runs, Standard 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 area of the border is 56.000 square feet.

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:circle

The volume of your fish pond is 39.270 cubic feet.
The surface area of your fish pond is 51.051 square feet.
The area of the border is 43.982 square feet.

The expected values for the volume and surface area are given in the Minimal portion of this write-up. If the calculated values do not agree with the values listed above, the functionality score will not be greater than the minimal score. (It could be less if the values are not reported with three places after the decimal point.)



1 0
Add a comment Improve this question Transcribed image text
Answer #1

# cook your dish here
print ("Available Fish Ponds are in the following shapes: circle, square, rectangle, oval, L")
print ("Select the shape for your fish pond: ",end=" ")
Pondshape = input()
print ("Depth of fish pond for challenge option : 18, 24, 30",end=" ")

Pdepth = float(input())
if (Pondshape == "circle"):
print ("Volume of your fish pond is %.3f" % (3.14159*2.5*2.5*(Pdepth/12))+(" cubic feet."))
print ("Surface area of your fish pond is %.3f" % (3.14159*2.5*2.5 + (2*3.14159*2.5*(Pdepth/12))) + " square feet.")

elif (Pondshape == "square"):
print ("Volume of your fish pond is %.3f" % (5*5*(Pdepth/12))+(" cubic feet."))
print ("Surface area of your fish pond is %.3f" % (25 + (4*5*(Pdepth/12))) + " square feet.")

elif (Pondshape == "rectangle"):
print ("Volume of your fish pond is %.3f" % (7*4*(d/12))+(" cubic feet."))
print ("Surface area of your fish pond is %.3f" % (28 + (22*(Pdepthd/12))) + " square feet.")

elif (Pondshape == "oval"):
print ("Volume of your fish pond is %.3f" % ((2*4 + 3.14159*2*2)*(Pdepth/12))+(" cubic feet."))
print ("Surface area of your fish pond is %.3f" % ((2*4 + 3.14159*2*2) + (2*3.14159*2*(Pdepth/12)) + (4*(Pdepth/12))) + " square feet.")

else:
print ("Volume of your fish pond is %.3f" % ((10*3 + 5*3)*(Pdepth/12))+(" cubic feet."))
print ("Surface area of your fish pond is %.3f" % ((10*3 + 5*3) + 20*(Pdepth/12) + 12*(Pdepth/12)) + " square feet.")

Add a comment
Know the answer?
Add Answer to:
Calculates thedimensions for various fish pond configurations. Specifically, theprogram will calculate the volume for...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • in C++ use Inheritance for the following Shape Circle Sphere Cylinder Rectangle Square Cube You must define one class for each shape. And, use public inheritance when deriving from base cla...

    in C++ use Inheritance for the following Shape Circle Sphere Cylinder Rectangle Square Cube You must define one class for each shape. And, use public inheritance when deriving from base classes. Circle int r; void area(); void perimeter(); void volume(); //No volume for circle Sphere int r; void area();//Sphere surface area= 4 × pi × radius2 void perimeter(); //No perimeter for Sphere void volume();//Sphere volume= 4/3 × pi × radius2 Cylinder int r, height; void area();// Cylinder surface area=perimeter of...

  • Show work please Optimization problems 1. (5 points) Find two nonnegative numbers whose sum is 25...

    Show work please Optimization problems 1. (5 points) Find two nonnegative numbers whose sum is 25 and so that the product of one number and the square of the other number is a maximum. 2. (5 points) Build a rectangular pen with two parallel partitions using 300 feet of fencing. What dimensions will maximize the total area of the pen? (5 points) An open rectangular box with square base is to be made from 48 ft.2 of material. What dimensions...

  • ng an average soil moisture condition on hydrologic soils group C, calculate the runoff volume (inches)...

    ng an average soil moisture condition on hydrologic soils group C, calculate the runoff volume (inches) for a 100-acre suburban development with the following land use when rainfall is 4 inches. You must use the NRCS-CN method and Table 5.11, Figure 5.11, or Equation 5.26. Percentage of Land 20 40 30 10 Land Use 4- acre residential lots 1/8- acre condominiums Commercial area with curbs Open space grass cover-85% What is the required area of a retention basin, in square...

  • Math 2413 Derivative Applications Assignment Due: Tuesday, June 18, 2019 (5:30 pm) Name Show all work....

    Math 2413 Derivative Applications Assignment Due: Tuesday, June 18, 2019 (5:30 pm) Name Show all work. Label your answers with the proper units. (3 points each ) A spherical ball is being inflated at the rate of 12 cubic inches per second. Find the rate at which the radius of the sphere is growing when the radius is 2 inches. long. 2. A 13 foot ladder is leaning against a wall. The base of the ladder is being palled away...

  • Revised by Prof. Kostadinov, Fall 2015, Fall 2014, Fall 2013, Fall 2012, Fall 2011, Fall 2010 Revised by Prof. Africk and Prof. Kostadinov Fall 2015, Spring 2016, #1 Identify the horizontal a...

    Revised by Prof. Kostadinov, Fall 2015, Fall 2014, Fall 2013, Fall 2012, Fall 2011, Fall 2010 Revised by Prof. Africk and Prof. Kostadinov Fall 2015, Spring 2016, #1 Identify the horizontal and vertical asymptotes of the following functions using the limit definitions: 2x2 o) yA- #2 Find the derivatives of the following functions using the definition of derivative: a) f(x)-2x-5x #3 Find the derivative v dr of the following functions, using the derivative rules: b) f(x)--2x +3x-4 #4 Find the...

  • Create a complete Assembly Language program implementation for the following application with a) 32-bit and b)...

    Create a complete Assembly Language program implementation for the following application with a) 32-bit and b) 64-bit version (If Possible) App1: Geometric Shape Calculator Companion. The program details (design, implementation, code, runs) should show evidence of technical proficiency with the following technological aspects: 1. a) Implementation using 32-bit programming. b) Re-implement using 64-bit programming. 2. Test plan; test cases implementing the test plan and screen shots displaying the executing the test cases. Note: a test plan should include various Normal,...

  • In C++ Amanda and Tyler opened a business that specializes in shipping liquids, such as milk,...

    In C++ Amanda and Tyler opened a business that specializes in shipping liquids, such as milk, juice, and water, in cylindrical containers. The shipping charges depend on the amount of the liquid in the container. (For simplicity, you may assume that the container is filled to the top.) They also provide the option to paint the outside of the container for a reasonable amount. Write a program that does the following: Prompts the user to input the dimensions (in feet)...

  • summarizr the followung info and write them in your own words and break them into different...

    summarizr the followung info and write them in your own words and break them into different key points.   6.5 Metering Chamber: 6.5.1 The minimum size of the metering box is governed by the metering area required to obtain a representative test area for the specimen (see 7.2) and for maintenance of reasonable test accuracy. For example, for specimens incorporating air spaces or stud spaces, the metering area shall span an integral number of spaces (see 5.5). The depth of...

  • summatize the following info and break them into differeng key points. write them in yojr own...

    summatize the following info and break them into differeng key points. write them in yojr own words   apartus 6.1 Introduction—The design of a successful hot box appa- ratus is influenced by many factors. Before beginning the design of an apparatus meeting this standard, the designer shall review the discussion on the limitations and accuracy, Section 13, discussions of the energy flows in a hot box, Annex A2, the metering box wall loss flow, Annex A3, and flanking loss, Annex...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT