Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Name:Nate Wheeler
- * Date:november 18, 2016
- * Course Number: csc220
- * Course Name: data structures
- * Problem Number: hw7
- * Email: nate23nate23@gmail.com
- * Short Description of the Problem:
- * recursive summation series formula
- */
- package Assignments;
- public class SumSeries {
- public static double sum(double x){
- if (x ==0)
- return 0;
- else
- return sum(x - 1.0) + x / (2.0 * x + 1.0);
- }
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- double anwser= sum(3);
- System.out.println(anwser);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement