Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am only needing help on figuring out how to calculate the height, base, total surface area, and volume of a square pyramid. How do

I am only needing help on figuring out how to calculate the height, base, total surface area, and volume of a square pyramid. How do I put them down as calculations in Python programming? Any guidance would be very much appreciated!
Problem:
Write a program to calculate the surface area and volume of a square pyramid.
A square pyramid has a base that is square, and all triangle faces are congruent isosceles triangles. (An isosceles triangle is a triangle in which two of the sides are equal.) Here is a picture of a square pyramid, and one that shows various labeled lines.
Length of the base: a
Height of the pyramid: h
Volume = a2h/3
Slant height, s = sqrt(h2+(a/2)2) This is the
Pythagorean Theorem part.
Area of one pyramid side = s*a/2
For this program you are to determine two things about a square pyramid, 1) the surface area of the four sides, and 2) the volume. Do not include the surface area of the base.
10 pts TEST CASES:
Attach a separate document (word or excel will do) that shows your hand calculations for the surface area and volume of these two pyramids:
#1: Height: 5.0 Base: 2.5
#2: Height: 2.5 Base: 4.3
#3: Height: 3 Base: 8
Show your work, not just the results. Use these test cases to test your program and verify it is returning the correct results.
Program:
Be sure that your program output is neatly presented to the user.
The program asks the user to enter the pyramid height (in feet) and length of the base (in feet).
Your program will need to determine the surface area of the faces by using the Pythagorean theorem. The formulas are in the box above.
Your output must neatly show the height, base, total surface area, and volume of the pyramid using 3 decimal places of accuracy for all values.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 12c SQL

Authors: Joan Casteel

3rd edition

1305251032, 978-1305251038

More Books

Students also viewed these Databases questions