Sum

// This program uses a function to sum up the sequence
// of integers from 1 to 10
class Sum {

    public static void main( String[] args ) {
	int theSum;
	theSum = sum(10);
	System.out.println(theSum);
    }


    //Sum up integers from 1 to N.
    // assume N > 0
    static int sum(int N) {
	int total=0;

	for ( int i=1; i<=10; i=i+1 ) {
	    total = total+i;
	}
	return total;
    }
}