Question: Activity # 1 : Pyramid area - team In engineering and science, we often want to calculate the effect of some complex behavior. To make

Activity #1: Pyramid area - team
In engineering and science, we often want to calculate the effect of some complex behavior. To make
this possible, we create a model of the behavior. A model attempts to describe the behavior in a way
that is understandable and computable. Some models are based on physical laws and principles, some
are based on replicating observations, and many are a combination of these. Once you have a model,
you can use it to analyze and predict the performance or behavior of some system or phenomenon. In
this activity, your team will need to develop a model to calculate a requested quantity of interest.
An ancient ruler has decided to build a Geometry Temple in the form of a square-base pyramid made up
of cubes with a given side (as illustrated below). The Temple has n layers, where the bottom layer is
nn meters and the top layer is a single cube. The ancient ruler wants the surface of the Temple to be
covered with gold. What is the total area of gold foil that is needed in order to accomplish this?
Your team has decided to help the ancient ruler. Your team needs to develop a model to calculate the
total area of gold foil that will cover the Temple (that is, to cover the visible side and top surface areas,
not the bottom and hidden areas).
Lab: Topic 6(team)
Write a program named pyramid_area1.py that will ask the user to input the length of one side of a
cube (in meters) and the number of layers of the pyramid. Your program must use a loop. After you
complete this program, write a second program named pyramid_area2.py that performs the same
calculation - but this time without a loop (hint: arithmetic progression). Your programs may NOT use
lists, tuples, or dictionaries.
Remember to test your code. The ancient ruler would not be happy if the ancient builders ran out of
gold foil before the Temple was covered completely. The ruler would get even more upset if the ancient
builders asked for more gold than was needed. Have your program format the output as shown below.
The area should be displayed using two (2) decimal places.
Example output (using inputs 1,5):
Enter the side length in meters: 1
Enter the number of layers: 5
You need 85.00 m^2 of gold foil to cover the pyramid
Note: Both programs should yield the same output!
Activity # 1 : Pyramid area - team In engineering

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!