Question: Please use Java Problem 1: Estimate PI class (EstimatePI.java) Description: A can be computed using the following series: 1 1 1 1 1 m(i)=4(1-+-+-+ (-1)
Problem 1: Estimate PI class (EstimatePI.java) Description: A can be computed using the following series: 1 1 1 1 1 m(i)=4(1-+-+-+ (-1) 3 5 7 9 11 2i-1 Write a Java class name EstimatePI to estimate the value of , which contains the following two methods: estimate(): which has one integer parameter indicating the i in the above equation, and returns the double value of estimated main(): ask the user to enter a positive integer, pass it as the argument to the estimate() method, and display the returned value. Outputs $java EstimatePI Please enter an integer: 10 The estimated value of n is: 3.0418396189294032 $java EstimatePI Please enter an integer: 1000 The estimated value of n is: 3.140592653839794
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
