Question: C++ question! Problem A: T Day (March 14) is Coming constants such as and e play an important role in science and engineering. Nowadays, we

C++ question!

C++ question! Problem A: T Day (March 14) is Coming constants suchas and e play an important role in science and engineering. Nowadays,

Problem A: T Day (March 14) is Coming constants such as and e play an important role in science and engineering. Nowadays, we can find (approximate) values of important constants such as by using a calculator or a math library. But how did people calculate these constants prior to electronic calcu- lators and computers? This problem asks you to implement one formula for calculating an approximation to Specifically, you will need to use the formula 16 arctan (1/5)-4 arctan ( 1 /239) along with the arctangent series 3 5 7 This problem asks you to approximate using these formulas. To begin, first write a function double arctanApprox (double x, double tol) that uses the arctangent series above to calculate an estimate for arctan(x). This function should first estimate arctan(x) using just one term from the series, then using two terms. If these two estimates are strictly within the tolerance, then return the two-term estimate. If not, find an estimate using three terms, and if that is strictly within the tolerance of the two-term estimate, return the three term estimate. Otherwise continue in this fashion, generating a new estimate containing one more term in the series than the previous estimate, stopping when the new and previous estimates are strictly within the tolerance, and then returning the new estimate. Once you have your arctangent function working, notice that you can get an approximation for T by using the arctangent series to give approximations for both 1.0/5.0 and 1.0/239.0, and then combining them as in the formula above. So write a main program that does the following: 1. Your program should first ask the user to input a tolerance. Validate that the input value is positive, if not, ask the user to input another value. Do this repeatedly until the user inputs a valid value

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!