Написать программу , которая вычисляет площадь и периметр трапеции

3 Мая 2024 в 19:40
44 +1
0
Ответы
1

def calculate_trapezium_area(base1, base2, height):
area = 0.5 (base1 + base2) height
return area

def calculate_trapezium_perimeter(base1, base2, side1, side2):
perimeter = base1 + base2 + side1 + side2
return perimeter

base1 = float(input("Enter the length of the first base of the trapezium: "))
base2 = float(input("Enter the length of the second base of the trapezium: "))
height = float(input("Enter the height of the trapezium: "))
side1 = float(input("Enter the length of the first side of the trapezium: "))
side2 = float(input("Enter the length of the second side of the trapezium: "))

area = calculate_trapezium_area(base1, base2, height)
perimeter = calculate_trapezium_perimeter(base1, base2, side1, side2)

print("The area of the trapezium is: {:.2f}".format(area))
print("The perimeter of the trapezium is: {:.2f}".format(perimeter))

28 Мая 2024 в 20:15
Не можешь разобраться в этой теме?
Обратись за помощью к экспертам
Гарантированные бесплатные доработки в течение 1 года
Быстрое выполнение от 2 часов
Проверка работы на плагиат
Поможем написать учебную работу
Прямой эфир