Skip to content

AdelitaMartinez/Square-Pyramid-Calculator-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Square Pyramid Calculator

Overview

The Square Pyramid Calculator is a Python program designed to calculate the surface area and volume of a square pyramid. This tool is especially useful for solving problems involving square pyramids where the height and the base length are known.

Purpose

The purpose of this program is to find the surface area and volume of a square pyramid using the provided height and base length. The formulas used in the calculations are:

  • Volume: [ \text{volume} = \frac{a^2 \times h}{3} ]
  • Slant Height: [ \text{slant height} = \sqrt{h^2 + \left(\frac{a}{2}\right)^2} ]
  • Area of one pyramid side: [ \text{area one side} = \frac{\text{slant height} \times a}{2} ]
  • Surface Area of the four sides: [ \text{surface area} = 4 \times \text{area one side} ]

How to Use the Program

  1. Input the Height of the Pyramid:
    When prompted, enter the height of the pyramid.

  2. Input the Length of the Base:
    When prompted, enter the length of the base of the pyramid.

  3. View the Results:
    The program will calculate and display the volume and surface area of the pyramid.

Code Explanation

The program begins by displaying a welcome message and instructions. It then prompts the user to input the height and the base length of the pyramid. Using these inputs, it calculates the volume and surface area of the square pyramid. The results are then displayed.

Dependencies

This program requires Python 3 and the math module to run.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages