Moved AreaCalc to tools dir and fixed triangle

This commit is contained in:
Aroy 2021-01-21 16:43:12 +01:00
parent 449e95dd3f
commit 82ef828864

View file

@ -97,19 +97,15 @@ if calcOpti == 9: # Calculating the volume of a sphere.
if calcOpti == 10: # Calculating the area of a triangle if calcOpti == 10: # Calculating the area of a triangle
print('\nYou have chosen the option: Triangle') print('\nYou have chosen the option: Triangle')
print('Base = Any one of the three sides.') sideA = float(input('How Wide is aide A: '))
Base = float(input('How Wide is Base: ')) sideB = float(input('How Wide is side B: '))
print('\nHeight = The distance between the base\nand the corner opposite the Base') Answer = sideA * sideB / 2
Height = float(input('How high is the heigth: '))
Answer = Base * Height / 2
print(f'The Triangle Area is: {Answer:.6f}') print(f'The Triangle Area is: {Answer:.6f}')
if calcOpti == 11: # Calculating the volume of a prism. if calcOpti == 11: # Calculating the volume of a prism.
print('\nYou have chosen the option: Prism') print('\nYou have chosen the option: Prism')
print('Base = Any one of the three sides.') sideA = float(input('How Wide is aide A: '))
Base = float(input('How Wide is Base: ')) sideB = float(input('How Wide is side B: '))
Height = float(input('How high is the heigth: '))
print('\nHeight = The distance between the base\nand the corner opposite the Base')
Length = float(input('How long is the Prism: ')) Length = float(input('How long is the Prism: '))
Answer = Base * Height / 2 * Length Answer = sideA * sideB / 2 * Length
print(f'The Prism Volume is: {Answer:.6f}') print(f'The Prism Volume is: {Answer:.6f}')