logo CodeStepByStep logo


Language/Type: VB for loops function basics return

Write a function named FractionSum that accepts an integer parameter n and returns as a double the sum of the first n terms of the sequence:

fraction sum equation

In other words, the function should generate the following sequence:

1 + (1/2) + (1/3) + (1/4) + (1/5) + ...

You may assume that the parameter n is non-negative.

Function: Write a VB function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.