quick question: I tried something like this with a formula that was supposed to produce pi to something like the 7th power. I did double pi and it only showed two dec points
I took what you said into consideration and this is what I have come up with, but nothing has changed. Anymore pointers to get me going in the right direction?
int main()
{int terms;
cout << "Enter the desired number of terms for the summation.";
cin >> terms;
cout << setprecision(10) << EstimatePie(Pie);
return EstimatePie(Pie);
}
double EstimatePie(int terms)
{double value, Pie;
cout << "Enter an integer to be evaluated.";
cin >> value;
if(value>0)
{Pie = value * (4.0 - (4.0/3.0) + (4.0/5.0) - (4.0/7.0) + (4.0/9.0) - (4.0/11.0));}
return Pie;}
Here you are trying to call the function EstimatePie, passing it the variable Pie... which does not exist. Read the compiler errors. It will tell you this without you having to come to ask us.