Approximate Convergent Series

This assignment is intended to see if youve learned the basic concepts talked about thus far in the lectures.

You will be required to take pre-existing code and augment it download the cpp attached to this assignment, and copy paste the code, or create a new blank project and import the cpp file.

Program

Use the code provided and augment it.

This program will allow you to approximate the value of the series below by calculating the partial sum of the convergent series to a user inputted number of terms. see image.

This series could also be written: see image.

1. The program will perform the estimation twice

  • Ask the user for two positive integers

2. The program will calculate the partial sum twice, with the 2 entered values

  • Once using the first value and the function void sum1(double& sum, unsigned int n)
  • And again with the second value and double sum2(unsigned int n)

3. Your program must implement (fill in) these functions with out changing the function signatures (prototype/header)

4. Your program should output the two (decimal) values and indicate if the two values are exactly the same.

Sample Output:

Number of interations to complete (n, for trial 1)
6
Number of interations to complete (n, for trial 2)
12
Calculating...Done
Using pass by reference, the partial sum using 6 terms is:
0.595238
Using pass by value, the partial sum using 12 terms is:
0.669872
The two calculations did not result in the exact same value
Number of interations to complete (n, for trial 1)
29
Number of interations to complete (n, for trial 2)
29
Calculating...Done
Using pass by reference, the partial sum using 29 terms is:
0.716092
Using pass by value, the partial sum using 29 terms is:
0.716092
The two calculations did result in the exact same value
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.