1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
solmaris [256]
3 years ago
10

Define a function pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a pyram

id with a rectangular base. Sample output with inputs: 4.5 2.1 3.0 Volume for 4.5, 2.1, 3.0 is: 9.45 Relevant geometry equations: Volume

Engineering
1 answer:
Maslowich3 years ago
5 0

Hi, you haven't provided the programing language in which you need the code, I'll just explain how to do it using Python, and you can apply a similar method for any programming language.

Answer:

1. def pyramid_volume(base_length, base_width, pyramid_height):

2.     volume = base_length*base_width*pyramid_height/3

3.     return(volume)

Explanation step by step:

  1. In the first line of code, we define the function pyramid_volume and it's input parameters
  2. In the second line, we perform operations with the input values to get the volume of the pyramid with a rectangular base, the formula is V = l*w*h/3
  3. In the last line of code, we return the volume  

In the image below you can see the result of calling the function with input 4.5, 2.1, 3.0.

You might be interested in
The following is a list of metals and alloys:
viktelen [127]

Answer:

A) Gray cast iron

B) Aluminum

C) Titanium alloy

D) Tool steel

E) Titanium alloy

F) magnesium

G) Tungsten

5 0
3 years ago
PythonA group of statisticians at a local college has asked you to create a set of functionsthat compute the median and mode of
skelet666 [1.2K]

Answer:

  1. def median(l):
  2.    if(len(l) == 0):
  3.       return 0
  4.    else:
  5.        l.sort()
  6.        if(len(l)%2 == 0):
  7.            index = int(len(l)/2)
  8.            mid = (l[index-1] + l[index]) / 2
  9.        else:
  10.            mid = l[len(l)//2]  
  11.        return mid  
  12. def mode(l):
  13.    if(len(l)==0):
  14.        return 0
  15.    mode = max(set(l), key=l.count)
  16.    return mode  
  17. def mean(l):
  18.    if(len(l)==0):
  19.        return 0
  20.    sum = 0
  21.    for x in l:
  22.        sum += x
  23.    mean = sum / len(l)
  24.    return mean
  25. lst = [5, 7, 10, 11, 12, 12, 13, 15, 25, 30, 45, 61]
  26. print(mean(lst))
  27. print(median(lst))
  28. print(mode(lst))

Explanation:

Firstly, we create a median function (Line 1). This function will check if the the length of list is zero and also if it is an even number. If the length is zero (empty list), it return zero (Line 2-3). If it is an even number, it will calculate the median by summing up two middle index values and divide them by two (Line 6-8). Or if the length is an odd, it will simply take the middle index value and return it as output (Line 9-10).

In mode function, after checking the length of list, we use the max function to estimate the maximum count of the item in list (Line 17) and use it as mode.

In mean function,  after checking the length of list,  we create a sum variable and then use a loop to add the item of list to sum (Line 23-25). After the loop, divide sum by the length of list to get the mean (Line 26).

In the main program, we test the three functions using a sample list and we shall get

20.5

12.5

12

3 0
3 years ago
What are the benefits of using the engineering design process
Shalnov [3]

Answer:

Some of the benefits are tangible for they are visible in the design and production process, while the other benefits are intangible which may not be visible directly but result in improvement in the quality of product, better control over designing and production process, reduction of stress on the designers etc.

7 0
3 years ago
A growing trend in urban design is the concept of a rooftop garden. If every building in a city were to install a rooftop garden
vlabodo [156]

Answer:The Urban heat island temperature will be REDUCED.

Two Impacts of Rooftop gardens

1) provision of shade against Sunlight.

2) It helps to purify the air around the building.

Explanation: Rooftop gardens are gardens made on top of the roofs of buildings, it is a Green initiative aimed at helping to improve the overall Environment.

Rooftop gardens have several significant benefits which includes

Reduction of the surrounding temperatures and the Urban heat Island temperatures.

Rooftop gardens helps to shade the roof from the direct impacts of harsh weather conditions.

Generally, plants are known as air purifiers as they remove the excess Carbondioxide around the environment through photosynthesis, and they also help to release water vapor which will help to improve the humidity of the environment.

5 0
3 years ago
Air modeled as an ideal gas enters a turbine operating at steady state at 1040 K, 278 kPa and exits at 120 kPa. The mass flow ra
gladu [14]

Answer:

a) T_{2}=837.2K

b) e=91.3 %

Explanation:

A) First, let's write the energy balance:

W=m*(h_{2}-h_{1})\\W=m*Cp*(T_{2}-T_{1})  (The enthalpy of an ideal gas is just function of the temperature, not the pressure).

The Cp of air is: 1.004 \frac{kJ}{kgK} And its specific R constant is 0.287 \frac{kJ}{kgK}.

The only unknown from the energy balance is T_{2}, so it is possible to calculate it. The power must be negative because the work is done by the fluid, so the energy is going out from it.

T_{2}=T_{1}+\frac{W}{mCp}=1040K-\frac{1120kW}{5.5\frac{kg}{s}*1.004\frac{kJ}{kgk}} \\T_{2}=837.2K

B) The isentropic efficiency (e) is defined as:

e=\frac{h_{2}-h_{1}}{h_{2s}-h_{1}}

Where {h_{2s} is the isentropic enthalpy at the exit of the turbine for the isentropic process. The only missing in the last equation is that variable, because h_{2}-h_{1} can be obtained from the energy balance  \frac{W}{m}=h_{2}-h_{1}

h_{2}-h_{1}=\frac{-1120kW}{5.5\frac{kg}{s}}=-203.64\frac{kJ}{kg}

An entropy change for an ideal gas with  constant Cp is given by:

s_{2}-s_{1}=Cpln(\frac{T_{2}}{T_{1}})-Rln(\frac{P_{2}}{P_{1}})

You can review its deduction on van Wylen 6 Edition, section 8.10.

For the isentropic process the equation is:

0=Cpln(\frac{T_{2}}{T_{1}})-Rln(\frac{P_{2}}{P_{1}})\\Rln(\frac{P_{2}}{P_{1}})=Cpln(\frac{T_{2}}{T_{1}})

Applying logarithm properties:

ln((\frac{P_{2}}{P_{1}})^{R} )=ln((\frac{T_{2}}{T_{1}})^{Cp} )\\(\frac{P_{2}}{P_{1}})^{R}=(\frac{T_{2}}{T_{1}})^{Cp}\\(\frac{P_{2}}{P_{1}})^{R/Cp}=(\frac{T_{2}}{T_{1}})\\T_{2}=T_{1}(\frac{P_{2}}{P_{1}})^{R/Cp}

Then,

T_{2}=1040K(\frac{120kPa}{278kPa})^{0.287/1.004}=817.96K

So, now it is possible to calculate h_{2s}-h_{1}:

h_{2s}-h_{1}}=Cp(T_{2s}-T_{1}})=1.004\frac{kJ}{kgK}*(817.96K-1040K)=-222.92\frac{kJ}{kg}

Finally, the efficiency can be calculated:

e=\frac{h_{2}-h_{1}}{h_{2s}-h_{1}}=\frac{-203.64\frac{kJ}{kg}}{-222.92\frac{kJ}{kg}}\\e=0.913=91.3 %

4 0
3 years ago
Other questions:
  • Consider the series solution, Equation 5.42, for the plane wall with convection. Calculate midplane (x* = 0) and surface (x* = 1
    5·1 answer
  • Your manager has asked you to research and recommend a writing guide that examiners in your digital forensics company can use fo
    8·1 answer
  • Which of the following explains why trucking is the most widely used transportation method?
    14·1 answer
  • If my current directory is ‘AR’ write the path for my current directory
    5·1 answer
  • Identify renewable energy sources you will propose. Explain the key elements to your solution and the basic technical principles
    5·1 answer
  • An astronomer of 65 kg of mass hikes from the beach to the observatory atop the mountain in Mauna Kea, Hawaii (altitude of 4205
    15·1 answer
  • I need the answer please
    7·1 answer
  • 6) Describe the differences between the troposphere and stratosphere.
    14·1 answer
  • On what kind of sectional drawing would you find the maximum length of a building?
    7·1 answer
  • A transformer has 300,000 windings in its primary coil and uses 12,000V AC input. (4 points) How many windings would be needed t
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!