Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Place your code in a class named Calculus.java. Each class should contain a main method which should do the following For the Calculus class: Implement

Place your code in a class named Calculus.java.
Each class should contain a main method which should do the following
For the Calculus class:
Implement the method pi to accept one integer parameter and return the value of the Pi constant value after the given term.
Implement the method euler to accept one integer parameter and return the value of the Euler constant value after the given term.
In the main method, use the for loop the iterate all terms and print constant values from:
1 to 30 for the pi method
1 to 18 for the euler method Pi value after 1 term(s)=3.4641016151377544
Pi value after 2 term(s)=3.0792014356780038
Pi value after 3 term(s)=3.156181471569954
Pi value after 4 term(s)=3.1378528915956805
Pi value after 5 term(s)=3.1426047456630846
Pi value after 6 term(s)=3.141308785462883
Pi value after 7 term(s)=3.1416743126988376
Pi value after 8 term(s)=3.141568715941784
Pi value after 9 term(s)=3.141599773811506
Pi value after 10 term(s)=3.1415905109380797
Pi value after 11 term(s)=3.1415933045030813
Pi value after 12 term(s)=3.1415924542876463
Pi value after 13 term(s)=3.14159271502038
Pi value after 14 term(s)=3.141592634547314
Pi value after 15 term(s)=3.141592659521714
Pi value after 16 term(s)=3.1415926517339976
Pi value after 17 term(s)=3.1415926541725754
Pi value after 18 term(s)=3.141592653406165
Pi value after 19 term(s)=3.1415926536478262
Pi value after 20 term(s)=3.1415926535714034
Pi value after 21 term(s)=3.141592653595635
Pi value after 22 term(s)=3.1415926535879337
Pi value after 23 term(s)=3.1415926535903864
Pi value after 24 term(s)=3.1415926535896035
Pi value after 25 term(s)=3.141592653589854
Pi value after 26 term(s)=3.141592653589774
Pi value after 27 term(s)=3.1415926535897998
Pi value after 28 term(s)=3.1415926535897913
Pi value after 29 term(s)=3.141592653589794
Pi value after 30 term(s)=3.1415926535897936
Euler value after 1 term(s)=1.0
Euler value after 2 term(s)=2.0
Euler value after 3 term(s)=2.5
Euler value after 4 term(s)=2.6666666666666665
Euler value after 5 term(s)=2.708333333333333
Euler value after 6 term(s)=2.7166666666666663
Euler value after 7 term(s)=2.7180555555555554
Euler value after 8 term(s)=2.7182539682539684
Euler value after 9 term(s)=2.71827876984127
Euler value after 10 term(s)=2.7182815255731922
Euler value after 11 term(s)=2.7182818011463845
Euler value after 12 term(s)=2.718281826198493
Euler value after 13 term(s)=2.7182818282861687
Euler value after 14 term(s)=2.7182818284467594
Euler value after 15 term(s)=2.71828182845823
Euler value after 16 term(s)=2.718281828458995
Euler value after 17 term(s)=2.718281828459043
Euler value after 18 term(s)=2.7182818284590455 pls
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions