Fig10_45 - sum += c[ j ]; c[ i ] = 2.0 * sum / i + i; }...

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

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

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

Ask a homework question - tutors are online