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 7 Consider the following code:
zhannawk [14.2K]

Answer:

Melon

Explanation:

The variable "list" containts a function that returns a price that is greater than or equal to 60.0.

In the variable "fruit", the only item in the array with a price attribute set above that number is the string Melon.

3 0
1 year ago
The system where the unit of measurement is centimeter
aleksklad [387]

Answer:

International System of Units

Explanation:

3 0
3 years ago
Why when you are on wifi it keeps kicking you off is your class during online learning​
Leviafan [203]
Sometimes, it lags on the other side or from the teachers computer so the app just kicks people out sometimes, it’s sucks I know
7 0
2 years ago
Read 2 more answers
Which task might be suitable for moving into a separate function so you can re-use it from multiple places in your code?
Fudgin [204]

Answer:

The answer is "All of these could make good functions ".

Explanation:

In the given question some information is missing, that is options which can be described as follows:

a. Ask the user to confirm an input with a yes/no answer

b. Sort some input data into an ordered list

c. All of these could make good functions

d. Calculate a complex mathematical expression

A method is a collection of ordered code and provides a generic code, that is used to execute a single, connected operation.

  • A good function is a function, which takes values from the user and it will sort all the data and store in memory, and whenever we call the function, it will give the values.
  • It is also used to calculate some complex values,
8 0
3 years ago
What are impacts of ict in every day your life?describe if prifely​
telo118 [61]

Answer:

ICT is a broad subject and a concept of evolving.It covers any product that will store, retrieve, manipulate, transmit, or receive information electronically in a digital form.

Explanation:

HOW WE USE ICT IN OUR DAILY LIFE

COMMUNICATION

JOB OPPORTUNITIES

EDUCATION

SOCIALIZING

POSITIVE IMPACT OF ICT IN OUR DAILY LIFE

1.Easy to access information:

I use ICT to access more information that I need for everyday schooling.Because Internet has more faster than searching to a school library. Even the deadline of my research is coming, I can make it fast with the help of ICT

2. Education: distance learning and on-line tutorials. New ways of learning, e.g. interactive multi-media and virtual reality.

3.Free access of sharing like photo,video,and message

5 0
2 years ago
Other questions:
  • In three to five sentences, explain how you would insert graphics using your word-processing software.
    7·2 answers
  • The collection of all possible vulnerabilities that could provide unauthorized access to computer resources is called the:
    12·1 answer
  • The create_python_script function creates a new python script in the current working directory, adds the line of comments to it
    9·1 answer
  • What do you call the process of translating statements written by a developer? What is the result of this process?
    6·1 answer
  • Technology has proliferated in Kenya and Somaliland, with text messages used to replace cash, creating mobile money use that, on
    11·1 answer
  • Suppose you are given a bag containing n unbiased coins. You are told that n − 1 of these coins are normal, with heads on one si
    7·1 answer
  • When using the Internet, it is important to know the validity of web page you are using. How can you know if the information is
    5·1 answer
  • Write a method so that the main() code below can be replaced by simpler code that calls method calcMilesTraveled(). Original mai
    11·1 answer
  • How are software myths affecting software process?. Explain with example​
    9·1 answer
  • Which tools can help you gather information about the processes running on a windows operating system?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!