Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Surface area and Volume of octagonal prism
- Author : Daniel Herrmann
- """
- title = "Right Regular Octagonal Prism Surface Area and Volume Calculator"
- print("*" * len(title))
- print(title)
- print("*" * len(title))
- print("")
- import math
- value_1 = input("Enter a base edge value : ")
- value_2 = input("Enter the height of prism : ")
- print("")
- a = int(value_1)
- h = int(value_2)
- area_of_prism = 8*a*h+4*(1+math.sqrt(2))*a**2
- answer_area = str(round(area_of_prism, 3))
- volume_of_prism = 2*(1+math.sqrt(2))*a**2*h
- answer_volume = str(round(volume_of_prism,3))
- print("Base Edge :", value_1)
- print("Height :", value_2)
- print("")
- print("Surface area : ", answer_area)
- print("Volume", answer_volume)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement