I am needing to write a program that calculates the amortization of pi. The output must look like this:
This program approximates pi using an n-term series expansion.
Enter the value of n> -3
-3 is an invalid number of terms.
or if it is a positive number that can actually be used for calculation:
This program approximates pi using an n-term series expansion.
Enter the value of n> 6
pi[6] = 4[1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11] = 2.97604617604617560644
I understand enough about c++ to know what to use, I just don't know it good enough to write the code. I understand that there will probably need to be a void function in order to calculate the amortization. Like I said, I understand the nuances and how they work I just can't apply them to write a successful c++ program. If anyone could help me with the more difficult parts of the program, like the calculation and correct print format that would be AWESOME!! Thank you for your time.