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
How do I add my bestie on brainy? /??!!! ​
ziro4ka [17]

Answer:

You have to remember their name on here

Explanation:

If u dont you cant talk to them again

3 0
3 years ago
When naming a file you should use the ___ instead of a space in a filename
Ymorist [56]
The underscore.
But actually you can use spaces in file names, in many file managers. I think it just shows you a space while it actually saves an underscore, or something like this.
5 0
3 years ago
Habilidades de la alfabetizacion digital?
Eva8 [605]

Answer:

La American Library Association (ALA) define la alfabetización digital como "la capacidad de utilizar las tecnologías de la información y la comunicación para encontrar, evaluar, crear y comunicar información, lo que requiere habilidades cognitivas y técnicas".

6 0
3 years ago
The scope of a variable declared within a for() loop is:
Leni [432]

Answer:

a

Explanation:

The variable declared in the for is accessible only within the for loop  and it goes out of scope once the loop get end

eg : for(int i=1;i<=10,i++) // variable i is declared

{

// variable i is visible only in this block,

}

//After this the variable i goes out of scope

5 0
3 years ago
Reasons why construct is a great beginner game engine
Vlada [557]

Answer:

Construct 2 is a very intuitive drag and drop for creating 2D games. The learning curve is super fast, and the interface looks a lot like Microsoft products, so it makes it an ideal tool for PC users who have never looked at a game engine before

Explanation:

8 0
3 years ago
Other questions:
  • Peak download rate for a 4g network is __________. select one:
    12·2 answers
  • The Active Directory Users and Computers tool can be used to:______.
    11·1 answer
  • What is infinite recursion?
    7·1 answer
  • Which of the following is a default letter assigned for the primary hard drive
    6·2 answers
  • 次のうち、ビジネスレターに適したフォントとポイントサイズの選択はどれですか?<br> 私を助けてください!私はあなたを最高にブランコにします!
    12·2 answers
  • Continuous data
    13·1 answer
  • What technology did one of the student's have to learn to use in order to help him with his homework in the film, "Disconnected:
    11·2 answers
  • which scheduling algorithm allocate the CPU firt to the process that request the CPU first, (a) first come first serve,(b) short
    9·1 answer
  • How many hours do you spend on the Internet per day?
    11·2 answers
  • I want the answer of this task ( using prolog language ) ASAP because the deadline is tomorrow. Please help :"
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!