///Name: Dakota Donahue ///Period: 5 ///Project Name: ///File Name: ///Date: 3/10/2016 import java.util.Scanner; public class AddingInForLoop { public static void main(String [] args) { Scanner keyboard = new Scanner(System.in); System.out.println( " Count to: " ); int n = keyboard.nextInt(); int total = 0; for ( int a = 1; a <= n; a = a+1 ) { System.out.print( a + " "); total = total + a; } System.out.println( " The total is " + total ); } }