My code is working. It currently asks the user to enter 10 numbers via a ForLoop. What I cant figure out how to do, is how I would go about adding the number that the user enters first to the second and adding that to the third etc? Any ideas?
import sun.jvm.hotspot.gc_implementation.parallelScavenge.PSYoungGen; import java.util.Scanner; /** * Created with IntelliJ IDEA. * User: polmcguigan * Date: 07/02/2013 * Time: 12:55 * UPDATE COMMENT ABOUT PROGRAM HERE */ public class TotalNumbers { public static void main(String[] args) { String name; final int REPEATUNTIL=10; int number,totalnumber, numberentered; Scanner keyboard = new Scanner(System.in); System.out.println("What is your name?"); name=keyboard.nextLine(); System.out.println("Please enter 10 whole numbers."); for (int count = 1; count <= REPEATUNTIL; number++) { System.out.println("Please enter a number "); number=keyboard.nextInt(); } }//main }//class