Fig10_43 - return 2.0 * sum / n + n; } } /* END */ / public...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Fig10_43 { /* START: Fig10_43.txt */ public static double eval( int n ) { if( n == 0 ) return 1.0; else { double sum = 0.0; for( int i = 0; i < n; i++ ) sum += eval( i );
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: return 2.0 * sum / n + n; } } /* END */ / public static void main( String [ ] args ) { System.out.println( &quot;eval( 10 ) = &quot; + eval( 10 ) ); } }...
View Full Document

This document was uploaded on 06/13/2011.

Ask a homework question - tutors are online