Calculating an average with an array in Java; Homework <p>I have a homework assignment, and these are the 5 questions,</p> <blockquote> <ol> <li>What is the total of all the elements in the array.</li> <li>What is the average of all the elements in the array.</li> <li>What are the largest and smallest numbers in the array. (one loop for both questions)</li> <li>Display all the odd numbers in the array. Use the modulus function (%) on page 46.</li> <li>Print every other number in the array.</li> </ol> </blockquote> <p>I am having trouble finding the average, or writing the code that finds it. </p> <pre><code>public class JavaApplication { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here int nums[] = {33,66,77,88,60,91,87,92,76,90}; int sum = 0; for (int i = 0; i &lt; 10; i++){ sum +=nums[i]; } System.out.println("The sum is " + sum); int average = 0; Here for (int i = 0; i &lt; nums.length; i++) { | sum = sum + nums[i]; | } System.out.println("Average value is " + average); and here. int min, max; min = max = nums [0]; for(int i=1; i &lt; 10; i++) { if(nums[i] &lt; min) min = nums[i]; if(nums[i] &gt; max) max = nums[i]; } System.out.println("min and max: " + min + " " + max); } } </code></pre> <p>This is my second week in this class, So please explain what needs to be added or not and thanks :)</p>