The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

help w/ storing/scanning numbers in arrays

these are my instructions
A Computer Technology Instructor has a small class of 10 students. The instructor evaluates the performance of students in the class by administering 2 midterm tests and a Final Exam.

Write a program that prompts the instructor to enter the 10 grades of Midterm 1 and store these numbers in an array. Next prompt for the 10 grades of Midterm2 and store these numbers in a different array. Next prompt for the 10 grades of the Final Exam and store these in a different array. Next add Midterm1 to Midterm2 to Final and store the total of grades in a different array. Next, scan the array that has the totals and identify the minimum grade and maximum grade. Inform the instructor of the minimum grade and maximum grade.

Note : do not assume that the grades are in the range 0 to 100. Your program should function properly whether the grades are in the range 0 to 100 or any other range.
*I'm using eclipse btw

it prompts me to enter my numbers and stores them in the array correctly but when it tells me what my lowest score it says 0.0 and my highest score is 0.0...also, im not sure exactly how to add the total of midterm1 to midterm2 to final exam or how scan the array..and it repeats my highest and lowest score

Re: help w/ storing/scanning numbers in arrays

Arrays are indexed at zero, so if you create an array of size n, the maximum array position you can access is n-1. So in your code, yourarray[10] will be out of bounds, yourarray[9] will be the last index in the array

Re: help w/ storing/scanning numbers in arrays

You also reduced the size of the array. Remember, the array indexes start at zero, so the last index is n-1 where n is the size of the array. So setting the size to 9, array[9] will be out of bounds and array[8] the last index. Setting to 10, array[10] will be out of bounds but array[9] the last index.