Write a program named pyramid_area1.py that will ask the user to input the length of one...
Fantastic news! We've Found the answer you've been seeking!
Question:
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/65096ff2ca152_1695117295859.jpg)
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/65096ffaa52c5_1695117303766.jpg)
Transcribed Image Text:
Write a program named pyramid_area1.py that will ask the user to input the length of one side of the prism (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 55.83 m^: gold fo to cover the pyramid Note: Both programs should yield the same output! Deliverables: There are three deliverables for this team assignment. Please submit the following files to zyBooks: ● pyramid_areal.py ● pyramid_area2.py Remember to include the team header at the top of your files. 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 triangle-base pyramid made up of triangular prisms with a given side (as illustrated below). The top and bottom of each prism is an equilateral triangle with the height of the prism equal to one side of the triangle. The Temple has n layers, where the bottom layer forms an equilateral triangle with a side length of n prisms, and the top layer is a single triangular prism. 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). Write a program named pyramid_area1.py that will ask the user to input the length of one side of the prism (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 55.83 m^: gold fo to cover the pyramid Note: Both programs should yield the same output! Deliverables: There are three deliverables for this team assignment. Please submit the following files to zyBooks: ● pyramid_areal.py ● pyramid_area2.py Remember to include the team header at the top of your files. 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 triangle-base pyramid made up of triangular prisms with a given side (as illustrated below). The top and bottom of each prism is an equilateral triangle with the height of the prism equal to one side of the triangle. The Temple has n layers, where the bottom layer forms an equilateral triangle with a side length of n prisms, and the top layer is a single triangular prism. 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).
Expert Answer:
Answer rating: 100% (QA)
The function pyramidareawithloop takes two arguments sidelength the length of one side of the prism and numlayers the number of layers in the pyramid Inside the function a variable totalarea is initia... View the full answer
Related Book For
The Science And Engineering Of Materials
ISBN: 9781305076761
7th Edition
Authors: Donald R. Askeland, Wendelin J. Wright
Posted Date:
Students also viewed these programming questions
-
What do you think the role of police officers should be in schools? Defend your position with examples.
-
You will design and implement your own data class. The class will store data that has been read as user input from the keyboard (see Getting Input below), and provide necessary operations. As the...
-
1. Insert a module and create a subroutine named Receipt(). Excel 2. Place a button with the name "Generate Receipt" that would link to this subroutine when clicked. Do the following parts from 3 to...
-
In a recent survey, 80% of the community favored building a police substation in their neighborhood. If 20 citizens are chosen, what is the mean and standard deviation for the number favoring the...
-
Meadows Enterprises Ltd. is a Canadian corporation located in Regina. The company operates a retail business that has shown consistent profits for several years. Cash generated from those profits has...
-
Solve the given systems of equations by either method of this section. 30P = 55-Q 19P + 140 + 32 = 0
-
Why is it important to evaluate your change management experiences and document them as lessons learned? AppendixLO1
-
The Cardinal Group had filed on a consolidated basis for several years with its wholly owned subsidiary, Swallow, Inc. The group used a calendar tax year. On January 25, 2014, Heron acquired all of...
-
**FINANCIAL ACCOUNTING** ^^PLEASE DO NOT COPY FROM OTHERS^^ Builder Inc had prepaid insurance of $1,600 on January 1, 2020. The opening balance relates to a 12-month insurance policy purchased on...
-
1. Case Exhibit 2 presents monthly data of units produced and sold, and actual costs incurred, for 24 months. B Create a scatterplot of costs and units. b. From your scatterplot, estimate the...
-
c her 31. mature in 2027(10 wars For bonds of similar risk and sued 12 bonds dated January 1, 2018, with a paid semially on June 30 and December 31. Problem - On January 1, 2018, Marta Emerprises...
-
Gordon Rivers, the city manager of Saratoga, Florida, pitched the proposed design schedule back at Jay Andrews. Jay Andrews is the project manager for Major Design Corporation (MDC). The city of...
-
Use the data from SE3-8 to prepare the closing entries for The Decade Company. Close the temporary accounts straight to retained earnings. The balance of \(\$ 8,500\) in the retained earnings account...
-
Draw a Keynesian cross diagram to show the effects of a rise in autonomous expenditure on an economy operating below full employment output.
-
Governments in many countries are acutely aware of the environmental problems that vehicle emissions can have. Many car manufacturers are exploring the production of electric vehicles, but production...
-
Draw a simple diagram of John Woodens pyramid of success. You can find it at the official Wooden website www.coachwooden.com/index2.html.
-
Consider the following transactions of Pendant Software Mar. 31 Recorded cash sales of $240,000, plus sales tax of 5 collected for the sale of New Jersey Apr 6 Sant Marth sales tax to the state...
-
Akramin just graduated with a Master of Engineering in Manufacturing Engineering and landed a new job in Melaka with a starting salary of RM 4,000 per month. There are a number of things that he...
-
Does the Youngs modulus of a material depend upon crystallographic directions in a crystalline material? Explain.
-
If the current density is 1.25 Acm 2 and the drift velocity is 10 7 cms, how many charge carriers are present?
-
Calculate the diffusion coefficients for the diffusion of hydrogen through BCC iron and FCC aluminum at room temperature (25C). For the diffusion of H into Al, D 0 = 0.11 cm 2 /s and Q = 9780...
-
What are some of the ways in which a firm can attain a successful retrenchment strategy?
-
In the Learning from Mistakes at the opening of the chapter, we discussed the struggles of LG in the mobile phone market. Choose a competing firm in this market (e.g., Apple, Samsung, Xiaomi, Huawei,...
-
Think of a firm that has attained a differentiation focus or cost focus strategy. Are its advantages sustainable? Why? Why not? (Hint: Consider its position vis--vis Porters five forces.)
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App