Then you need to make a list of the steps the program needs to take to do it.
Type: Posts; User: Norm
Then you need to make a list of the steps the program needs to take to do it.
Work on the steps to solve the problem first. When you have worked out the logic, THEN work on coding it.
Looks like you need to work on some logic for this part.
Sorry, I don't know what the next step is. Can you explain?
For testing reduce the size of the array to 3 and enter 3 different numbers like 1 22 55
then look at what the program prints out and see if there is something that stands out.
I'm done for tonight. Back tomorrow.
Did you add the numbers that were printed out? Was the sum different from what the code computed?
Double check the loop and the index used for the array.
Print out the contents of the array so you can see what you are adding up. Use the Arrays class's toString method to format the array for printing:
System.out.println("an ID "+...
You need to see how to write a for loop:
The for Statement (The Java™ Tutorials > Learning the Java Language > Language Basics)
You assign the value read in to a slot in the array at an index:
anArray[theIdx] = theValue;
then you increment the index so the next time the value will go into the next slot.
In a for loop, the...
Have you passed that to the compiler? It will tell you if there are problems. I could miss something that the compiler wouldn't.
I left out the word "to": use a loop to scan through the array.
Look at using an array to hold the grades that are read in. After reading all the grades, you will be able to use a loop to scan through the array and add them.