Question: Simple Python Program, Calculates PI based on Leibniz Formula. I want this program to be be broken down to 2 modules including a class related
Simple Python Program, Calculates PI based on Leibniz Formula.I want this program to be be broken down to 2 modules including a class related to the Leibniz formula. Also Create a constructor for use with the class. Divide the program into two modules one which contains class and another which creates an instance of it. The instance should report the property of pi.
# Function calculates PI based on Leibniz Formula def LeibnizPI(x): # Initialize and declare variables. num, den = 1.0, 1.0 counter = 1 user_input = x c = 0.0 while counter """This function contains the reusable error messages.""" print("You entered an invalid value. You must enter a positive integer.") main() def ending(): """Allows the user to run the program again or terminate it.""" print(" " "Type A to run the program again. " "Press Enter to end the program.") runagain = input() if runagain == "A": main() def main(): """This function controls the main thread of the program.""" print("Please enter the number of values to be calculated:") response = input() try: user_input = int(response) except ValueError: errorMessages() else: if user_input 1 35 7'9 11 2n +1 1 35 7 9 Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock

I want this program to be be broken down to 2 modules including a class related to the Leibniz formula. Also Create a constructor for use with the class. Divide the program into two modules one which contains class and another which creates an instance of it. The instance should report the property of pi.