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
QUESTION 9 of 10: Bob charged $200 for a plane ticket last month. When he received his statement, he saw that he could pay the m
IgorLugansk [536]

Answer:

yes cuz 25x8=200

Explanation:

3 0
3 years ago
Read 2 more answers
Which of the these is tool for creating mobile apps? A:C# B:Apple Pie C:Appy Pie D:C++​
Ratling [72]

Answer:

bhsjsbsbsb

Explanation:

<h3><em>bejwnsusb</em></h3>
4 0
3 years ago
Read 2 more answers
If you're unsure of what chart to use for a set of data, what feature does Excel include that will help you to decide? A. Sparkl
asambeis [7]
If what I found is correct it would be C, all charts... If not that then it would be B.
6 0
3 years ago
Read 2 more answers
18. which of these components is responsible for providing instructions and processing for a computer? a. cpu b. ssd c. ram d. r
cricket20 [7]

The components that is responsible for providing instructions and processing for a computer is a. CPU.

<h3>What area of the computer executes commands?</h3>

This command center's central processing unit (CPU) is a sophisticated, large-scale collection of electrical circuitry that carries out pre-stored program instructions. A central processing unit is a must for all computers, big and small.

Note that the CPU, RAM, and ROM chips are all located on the motherboard. The "brain" of the computer is known as the Central Processing Unit (CPU). It carries out instructions (from software) and directs other parts.

Learn more about CPU from

brainly.com/question/26991245
#SPJ1

7 0
1 year ago
Simplify to obtain a sum of products: (A+B)(C+B)(D?+B)(ACD?+E)
lilavasa [31]

Answer:

(ACD'+BE)

Explanation:

(A+B)(C+B)(D'+B)(ACD'+E)

Product of (A+B)(C+B)

(A+B)(C+B)=AC+AB+BC+B^2 = AC+B(A+C+B)=AC+B

Product of (D'+B)(ACD'+E) with AC+B

(AC+B)(D'+B)(ACD'+E)

(AC+B)(D'+B)=ACD' + ACB +BD +B = ACD'+B(AC+D+1)=ACD'+B

Then we get:

(ACD'+B)(ACD'+E) = ACD'+ACD'E+ACD'B+BE

ACD'(1+E+B)+BE =ACD'+BE

7 0
3 years ago
Other questions:
  • Suppose two hosts, A and B, are separated by 15,000 kilometers and are connected by a direct link of R = 5 Mbps. Suppose the pro
    11·1 answer
  • ____ is typically used with lans that have a star topology and can be used in conjunction with twisted-pair, coaxial, or fiber-o
    12·1 answer
  • What are paragraphs separated by
    9·1 answer
  • Una bombilla de 40 w de potencia está encendida durante 10 horas. Calcular la energía que ha consumido en julios y en kw·h.
    12·1 answer
  • What are the top and side margins for a letter typed in standard format?
    5·1 answer
  • Another name for divergent boundaries that occur under the ocean is
    6·2 answers
  • If you go over 255 in RGB by 1 does it reset to 0 or 1
    11·1 answer
  • Is the jane austen pride and prejudie a primary source
    6·1 answer
  • Write a python program that will read a number (num) and display all the numbers divisible by 3 or 5
    15·1 answer
  • Who invented Satellites? What purpose does it serve? How has it impacted society today?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!