Question: Create a graphical user interface that is suitable for use with the program (python language).use any version of python import math # This will import
Create a graphical user interface that is suitable for use with the program (python language).use any version of python
import math # This will import math module class PI: pi = 0 def calculate_pi(self,n): # function that return value of m(i) for input i sum = 0 for j in range(0,n): #iterate loop till 12 times sum = sum + (math.pow(-1,j)/((2*j)+1)) #summation of the Leibniz series pi = 4 * sum return float(pi) #return number def use_pi(self,r,pi): #shows usage of pi attribute in class radius=r area=pi*radius*radius #calculates Circle area return float(area) #print the output obj=PI() n = input('Enter number of values to be used in the pi calculation : ') p=obj.calculate_pi(int(n)) print (" pi = ", p) rad = input(' Enter radius of Circle : ') print (" Area of Circle = ", obj.use_pi(int(rad),p))
Your interface should reflect both the information you need to prompt for and what the output would look like based on your program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
