subject

The mathematical constant Pi is an irrational number with value approximately 3.1415928... The precise value of this constant can be obtained from the following infinite sum: Pi^2 = 8+8/3^2+8/5^2+8/7^2+8/9^2+...
(Pi is of course just the square root of this value.)
Although we cannot compute the entire infinite series, we get a good approximation of the value of Pi' by computing the beginning of such a sum. Write a function approxPIsquared that takes as input float error and approximates constant Pi to within error by computing the above sum, term by term, until the difference between the new and the previous sum is less than error. The function should return the new sum
>>>approxPIsquared(0.0001)
9.855519952254232
>>>approxPIsquared(0.00000 001)
9.869462988376474

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
This program will store roster and rating information for a soccer team. coaches rate players during tryouts to ensure a balanced team. (1) prompt the user to input five pairs of numbers: a player's jersey number (0 - 99) and the player's rating (1 - 9). store the jersey numbers in one int vector and the ratings in another int vector. output these vectors (i.e., output the roster). (3 pts) ex: enter player 1's jersey number: 84 enter player 1's rating: 7 enter player 2's jersey number: 23 enter player 2's rating: 4 enter player 3's jersey number: 4 enter player 3's rating: 5 enter player 4's jersey number: 30 enter player 4's rating: 2
Answers: 1
question
Computers and Technology, 22.06.2019 14:30
Hi plz 11 ! when planning a table, what step comes first: "define the column headers" or "calculate the number of columns/rows"? a. calculate the number of columns/rows b. define the column headers
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
What is the worst-case complexity of the maxrepeats function? assume that the longest string in the names array is at most 25 characters wide (i.e., string comparison can be treated as o( class namecounter { private: int* counts; int nc; string* names; int nn; public: namecounter (int ncounts, int nnames); int maxrepeats() const; }; int namecounter: : maxrepeats () { int maxcount = 0; for (int i = 0; i < nc; ++i) { int count = 1; for (int j = i+1; j < nc; ++j) { if (names[i] == names[j]) ++count; } maxcount = max(count, maxcount); } return maxcount; }
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
I'll mark brainliest if answered right! with which feature or menu option of a word processing program can you make an image like this? you can get this image using the option of a word processing program.
Answers: 1
You know the right answer?
The mathematical constant Pi is an irrational number with value approximately 3.1415928... The preci...
Questions
question
History, 10.03.2020 20:00
question
History, 10.03.2020 20:00
question
English, 10.03.2020 20:00
Questions on the website: 13722361