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
Identify the output, input, and any missing information for the following problem. George wants to find out how much extra he wi
rosijanka [135]

Answer:

The answer is $1600

Explanation:

Identify the output, input, and any missing information for the following problem. George wants to find out how much extra he will get paid next month. George gets paid $10 an hour and words 40 hour work weeks.

Usually, a month contains 4 weeks.

The formula we would use is : rate * hours per week * total weeks in a month.

The result would be 10x40x4 = $1600

3 0
4 years ago
Suppose the program counter (pc) is set to 0x2000 0000. is it possible to use the jump (j) mips assembly instruction to set the
lesya [120]
<span>With jump-YES. SInce we know that the instruction format of the jump instruction is 6 bits opcode and 26-bit jump address we can sufficiently encode the given address in the 26-bit space.</span>
7 0
4 years ago
PLEASE HELP ME ON THIS what is the slide sorter used f or? A. viewing presentation notes B. editing the slide content C. changin
Oduvanchick [21]
I use PowerPoint a lot and C would be correct
7 0
3 years ago
Which risk management framework does the organization of standardization publish
olga2289 [7]

Answer:

ISO 31000:2009 publishes principles and generic guidelines on risk management.

Explanation:

ISO 31000:2009 can be applied to any public, private or community company, organization, society or individual. Hence, ISO 31000:2009 is not particular to either business or area.

ISO 31000:2009 can be implemented during the period of an industry and to a broad variety of actions, including policies and judgments, guidance, methods, functions, plans, goods, services, and assets.

ISO 31000:2009 can be implemented to any type of danger, whatever its kind, whether possessing positive or negative outgrowths.

3 0
4 years ago
A business-to-consumer (B2C) website tracks the items you place in a shopping cart using _____. Group of answer choices the Tran
steposvetlana [31]

Answer:

The answer is "cookies".

Explanation:

The B2C websites refer to companies, that directly sell services and products without the need for a distributor. It refers to the online merchants, which provide the offer on the products and services via the internet to customers.  It uses the cookie in a small amount of data within the browser memory for the process and once you visit those websites on the internet, OS transfer cookies for your internet browser. It includes an ID as well as its URL, and the incorrect choice can be defined as follows:

  • The TLS protocol is the wrong choice because it is used in the privacy and data security.
  • The crawlers are also a wrong choice because it is used in automatically searches.
  • An electronic wallet is used to store your money, that's why it is wrong.
7 0
4 years ago
Other questions:
  • A. When executing System.out.println(a1), the toString() method in the Object class is invoked.
    14·1 answer
  • A network manager prevents users accessing certain websites. She does this by setting up:
    7·1 answer
  • Which type of multiple inheritance does Java support?
    15·1 answer
  • In the Page Layout view, the ruler measurement is displayed in _______.
    13·1 answer
  • The 2 main types of copyright relevant to the recording industry?
    5·2 answers
  • Find the maximum value and minimum value in below mention code. Assign the maximum value to maxMiles, and the minimum value to m
    11·1 answer
  • IT organizations implement powerful information systems like ERP and SCM that provide centralized data repositories. In addition
    11·2 answers
  • Abigail is writing an email to Justine Swenson, a friend of her best friend, Jane, inviting her to a get-together.
    7·1 answer
  • ANSWER ASAP!!!!!!
    12·2 answers
  • Activity #2
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!