# Title: Shapes program # Author: Jacob # Date: 12 November # Version: 1 # Purpose: Calculate the area and perimiter of shapes import math # Welcome message print("Welcome to the Shapes Calculator!") print("This program calculates the area and perimeter") print("of squares, rectangles and circles.") choice = "yes" while choice.lower() == "yes": shape = input( "\nPlease enter square, rectangle or circle: " ).lower() if shape == "square": length = float(input("Enter the length: ")) perimeter = length * 4 area = length ** 2 print("\nShape: Square") print("Length:", length) print("Perimeter:", perimeter) print("Area:", area) elif shape == "rectangle": length = float(input("Enter the length: ")) width = float(input("Enter the width: ")) perimeter = 2 * (length + width) area = length * width print("\nShape: Rectangle") print("Length:", length) print("Width:", width) print("Perimeter:", perimeter) print("Area:", area) elif shape == "circle": radius = float(input("Enter the radius: ")) circumference = 2 * math.pi * radius area = math.pi * radius ** 2 print("\nShape: Circle") print("Radius:", radius) print("Circumference:", circumference) print("Area:", area) else: print("Invalid shape. Please try again.") choice = input( "\nWould you like to calculate another shape? (yes/no): " ) print("\nThank you for using the Shapes Calculator!") print("Program has ended. Goodbye!")