# This program inputs a radius and calculates the area and circumference of a # circle # creates circle class class Circle: # constructor def __init__(self, radius): self.radius = radius self.circumference = 0 # getter and setter for radius def get_radius(self): return self.radius def set_radius(self, radius): self.radius = radius # calculates area and returns it def calc_area(self): return 3.14 * self.radius**2 # calculates circumference and returns it def calc_circumference(self): self.circumference = 3.14 * 2 * self.radius return self.circumference def calc_arc(self, angle): percentage_of_circle = angle/360 return self.circumference * percentage_of_circle def main(): # gets input from user radius = int(input("Enter radius of circle: ")) # creates new circle object circle1 = Circle(radius) # prints out radius of circle1 object print("Radius: {}".format(circle1.get_radius())) # prints area of circle1 object print("Area: {}".format(circle1.calc_area())) # prints circumference of circle1 object print("Circumference: {}".format(circle1.calc_circumference())) arc_angle = int(input("Enter arc angle: ")) print("Arc length with angle of {} is {}".format(arc_angle, circle1.calc_arc(arc_angle))) # Starts the program main()