#Title: Shapes program #Author: Joel Brown #Date: 4/11/26 #Version: 2 #Purpose: The program will ask how many tickets are being purchased and cost for a ticket, to calculate the total price if the criteria is met. ## Circle formula ## Area = π r² ## Circumference = 2 π r ## Square formula ## Perimeter = L x 4 ## Area = L² import math choice = "y" print("This program calculates the perimeter and area of different shapes.. let's begin") while choice == "y": ## Input shape = input("Enter s for square, r for rectangle or c for circle ") print("") if shape == "s": print("square") side_length = int(input("Enter the length of a side ")) perimeter = side_length * 4 area = side_length * side_length print(f"The perimeter of the square is {perimeter} m the area is {area} m²") elif shape == "c": print("circle") radius = int(input("What is the radius? ")) circumference = math.floor((2 * math.pi * radius) * 100) / 100 area = math.floor((math.pi *(radius * radius)) * 100) /100 print(f"The area of the circle is {area} m², the circumference is {circumference} m") elif shape == "r": print("rectangle") side_length = int(input("What is the length? ")) side_width = int(input("What is the width? ")) perimeter = (side_length * 2) + (side_width * 2) area = (side_length * side_length) + (side_width * side_width) print(f"The perimeter of the rectangle is {perimeter} m the area is {area} m²") ## Start program again choice = input("Do you want to pick another shape? (y or n) ") ## Display output print("The program has ended")