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:
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...
-
Two rods are connected by a slider block as shown. Neglecting the effect of friction, determine the couple MA required to hold the system in equilibrium. 200 D. 200 mm 15 N-m
-
Blossom Company purchased a new machine on October 1, 2025, at a cost of $90,640. The company estimated that the machine has a salvage value of $9,040. The machine is expected to be used for 70,500...
-
Listed below are additional research questions and hypotheses from actual published articles. For each hypothesis, identify the independent and dependent variable. a. It is expected that achievement...
-
Kiki Company has the following two types of stock: 1. 15,000 shares of 10% cumulative preferred stock with a $30 par value. 2. 30,000 shares of common stock with a $1 par value. Kiki Company declared...
-
Tanner-UNF Corporation acquired as a long-term Investment $170 million of 6% bonds, dated July 1, on July 1, 2024. Company management has the positive Intent and ability to hold the bonds until...
-
Alice J. and Bruce M. Byrd are married taxpayers who file a joint return. Their Social Security numbers are 123-45-6789 and 111-11-1111, respectively. Alice's birthday is September 21, 1966, and...
-
Write a C++ program with exception handling to process right triangles which includes the following: A class for right triangles including o the 3 sides (a,b,c), and 3 angles (in degrees) of a right...
-
Describe five different ways of producing an IntStream. Which of them can be adapted to producing a DoubleStream?
-
Write a static generic method: that returns a list of the values returned by the function when called with arguments in the values list. List map (List values, Function f)
-
Give a SQL query that lists all customers not in Hawaii. Invoice Invoice_ Number INTEGER 11731 11732 11733 Customer_ Number INTEGER 3175 3176 3175 Payment DECIMAL (10, 2) 0 249.50 0
-
Modify the WebGet program to print only the title of the returned HTML page. An HTML page has the structure ... ... For example, if you run the program by typing at the command line java WebGet...
-
Provide a static method that reverses the elements of a generic array list.
-
Explain serializability of transaction. OR Explain both the forms of serializability with example. Also explain relation between two forms. OR Explain conflict serializability and view...
-
The Heese Restaurant Group manufactures the bags of frozen French fries used at its franchised restaurants. Last week, Heeses purchased and used 101,000 pounds of potatoes at a price of $ 0.70 per...
-
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...
-
Describe the role of a paralegal in a family law practice.
-
Define family law and identify the kinds of issues that are addressed in a family law practice.
-
Describe the characteristics of effective fee agreements, and identify the various types of fee agreements that may be used in divorce cases.
Study smarter with the SolutionInn App