# Title: Calculate perimeter of a paddock # Author: Hailey Lau # Date: 26 may 2025 # Version: Version 1 # Purpose: calculate the perimeter of a paddock and display the price print('Welcome to the fence calculator program') print('To use this program you will enter the length and width of a paddock and the price to put a fence around it...lets begin') repeat = "" while repeat =="": #collect input: length, width, & cost length = float(input('What is the length? ')) width = float(input('What is the width? ')) price = float(input('What is the price per meter? ')) #formulas # Rectangle: perimeter = 2 x (length + width) # or perimeter = 2 x length + 2 x width # Square: perimeter = 4 x length shape = input('sqaure or rectangle?') if shape == 'square': perimeter = length * 4 elif shape == 'rectangle': perimeter = 2 * (width + length) # display results print(f'The perimeter of the paddock is {perimeter} meters') # calculate the total cost cost = perimeter * price print(f'The total cost to put a fence around the paddock is ${cost}') repeat = input(" To repeat the program press any key to end it") print('The program has ended')