YCP Logo Lab 9: Series sum revisited

Due: Friday, Sept 19th by 11:59 PM

Getting started

If you have a solution open in Visual Studio, close it (File->Close Solution).

Download CS200_Lab9.zip. Import it into Visual Studio (File->Import...).

Add your code to the source file called Series.c.

Your task

In Lab 6 you wrote a program to compute the sum of the first 7 terms of the following series:

1/2 + 1/4 + 1/8 + 1/16 + 1/32 + ...

In this lab, you will write a program to prompt the user for the number of terms of the series to compute.

Example run of the program (user input in bold):

How many terms? 15
sum is 0.999969

Hints

Start by thinking about how, in the body of your loop, you can compute increasing powers of two (2, 4, 8, 16, etc.)

Submit

When you are done, choose Tools->Submit to submit your completed lab to the server. You will need to enter your Marmoset username and password.

If the Tools->Submit option does not work, create a zip file containing the files in your project, and upload it to the submission server as lab9. The server URL is

https://camel.ycp.edu:8443/