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
yarga [219]
2 years ago
12

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

pyramid 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 = base area x height x 1/3
Base area = base length x base width.

given to me
''' Your solution goes here '''
length = float(input())
width = float(input())
height = float(input())
print('Volume for', length, width, height, "is:", calc_pyramid_volume(length, width, height))
Computers and Technology
1 answer:
Sever21 [200]2 years ago
8 0

The missing segment of the code illustrates the use of functions.

Functions are also referred to as <em>procedures or methods</em>; they are set of instructions that act as one.

The code segment that complete the code in the question is as follows:

<em>def calc_pyramid_volume(length, width, height): </em>

<em>    baseArea = length * width </em>

<em>    Volume = baseArea * height * 1/3 </em>

<em>    return Volume</em>

<em />

<em />

The first line of the code segment declares the function itself

<em>def calc_pyramid_volume(length, width, height):</em>

Then, the base area of the pyramid is calculated

<em>    baseArea = length * width</em>

Then, the volume of the pyramid is calculated

<em>    Volume = baseArea * height * 1/3</em>

Lastly, the volume is returned to the main method

<em>    return Volume</em>

So, the complete code (without comments) is:

<em>def calc_pyramid_volume(length, width, height): </em>

<em>    baseArea = length * width </em>

<em>    Volume = baseArea * height * 1/3 </em>

<em>    return Volume </em>

<em>     </em>

<em>length = float(input()) </em>

<em>width = float(input()) </em>

<em>height = float(input()) </em>

<em>print('Volume for', length, width, height, "is:", calc_pyramid_volume(length, width, height))</em>

<em />

See attachment for the sample run

Read more about functions at:

brainly.com/question/17225124

You might be interested in
Choose the sentences that describe techniques of formatting text.
OLEGan [10]

I'm sorry if this answer has come to late.

Answer:

She opened her type tool and wrote in 'Happy Thanksgiving at the bottom of the image. She smoothed the edges of the text and changed its color. She then placed the text on a rug and tilted it to create an effect that showed as if the text was written on the rug.

Hope this helps!

8 0
3 years ago
An optimal solution to a linear programming problem MUST lie A. somewere on the line between two corner points. B. somewhere out
g100num [7]

Answer:

D. at the intersection of at least two constraints.

Explanation:

Linear programming is an optimization technique which is fine for the purpose of getting the best solution such as maximizing profit or certain o 4th era quantities. It is fine by modelling real life problems into mathematical models that have linear relationships or constraints such as in the form of objective functions. In linear programming, an objective function defines the formula for quantity optimization and the goal from this is to determine variable values that maximize or minimize the objective function depending on the problem robbery solved.

8 0
3 years ago
Spam and i report
defon

Answer:

option d is the correct answer

8 0
2 years ago
Read 2 more answers
Your boss in the human resources department asks you to write a function that calculates the length of time that employees have
Tems11 [23]

Answer:

Option D is correct i.e., =DATEDIF(C2, $AE$2, "y").

Explanation:

The user's supervisor well into the following department tells him to compose the feature which measures the amount that times staff has served in their company utilizing the DATEDIF feature. Consider whether C2 includes the hiring dates for that staff and then that cell $AE$2 includes the cut-off point for whom to evaluate the hiring time with the duration of the service.

So, therefore the following option is correct according to the given scenario.

4 0
3 years ago
Computer is an example of​
MAXImum [283]

Answer:

Computer is an example of electronic device.

7 0
2 years ago
Read 2 more answers
Other questions:
  • Clicking the _____ box completes an entry. cancel formula enter tab
    15·1 answer
  • Which of the following correctly describes the reason for quality customer service?
    15·2 answers
  • In your memo, give three new employees directions for starting the computer and opening a word-processing document.
    9·1 answer
  • Describe an application or a situation in which it is not convenient to use a linked list to store the data of the application
    12·1 answer
  • A chef writing up her famed recipe for beef stew realizes she has switched parsley and oregano everywhere in the recipe. The che
    13·1 answer
  • __________ is a program that lets you share documents online with others.
    12·2 answers
  • )finding an unused location in the hash table is called
    5·1 answer
  • It is believed that Taiwan is the original home of these early Oceania explorers. Maori Lapita Polynesians Aborigines
    13·2 answers
  • What are the tools in creating an animation?
    7·1 answer
  • Consider our authentication protocol 4.0, in which Alice authenticates herself to Bob, which we saw works well (i.e., we found n
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!