Sum of Series 2 : Convergent Series

Java Programming Course


Course 1: Problem-Solving and Computational Thinking in Java

Sprint 5: Working with Looping Constructs


Problem Statement

Calculate the sum of the following series

$$sum=1+1/2+1/4+1/8+...+1/n$$

Where n is a number input by the user.


Task

  1. Open the source code file and complete the code.
  2. Open the test case file and run the test cases to check your code.