// 5.5 Sum.java
// Counter-controlled repetition with the for structure

// Java extension packages
import javax.swing.JOptionPane;

public class Sum
{
	// main method begins execution of Java Application
	public static void main ( String args[] )
	{
		int sum = 0;
		
		// sum even integers from 2 to 100
		for ( int number = 2; number <= 100; number +=2 )
		sum += number;
		
		//display results
		JOptionPane.showMessageDialog ( null, "The sum is " + sum, 
		"Sum even integers from 2 to 100",
		JOptionPane.INFORMATION_MESSAGE );
		
		System.exit ( 0 ); // teminate application
	} // end main method
} // end class Sum