Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*6.13 ( Estimate ) can be computed using the following summation: m ( i )=4(1(1/3)+(1/5)(1/7)+(1/9)(1/11)++((1)^( i +1))/2 i 1) Write a function that returns m(i)

*6.13 (Estimate ) can be computed using the following summation:

m(i)=4(1(1/3)+(1/5)(1/7)+(1/9)(1/11)++((1)^(i+1))/2i1)

Write a function that returns m(i) for a given i and write a test program that displays the following table:

image text in transcribed

My program runs into an error when I input my value of i:

#include #include

using namespace std;

int main() { double pi(double i), i = 0; int count = 0, j = 1; double mi = 0;

cout > i;

for (double den = 1; den

else { mi = mi - (1 / den); count = 0; } double r = pow(10.0, -ceil(log10(fabs(mi*4.0000)))); return (round((mi*4.0000)*r) / r); } for (double j = 1; j

Sample Run for Exercise06_13 command>Exercisee6 13 181 281 301 401 501 601 701 801 901 4.800 3.1515 3.1466 3.1449 3.1441 3.1436 3.1433 3.143e 3.1428 3.1427 command>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions