import java.util.Scanner;
public class Zad01 {
public static void main(String[] args) {
int [] n; n = new int [9]; //install
n[0] = 1;
n[1] = 3;
n[2] = 5;
n[3] = 3;
n[4] = 4; //Grades
n[5] = 2;
n[6] = 2;
n[7] = 3;
n[8] = 3;
int cnt;
System.out.println("Grades:");
for(cnt = 0;n.length > cnt;cnt++)
{
System.out.println(n[cnt]);
if()
{
}
else
{
System.out.println("Error");
}
}
}
}
I’m not sure what to put in (if).Basically what i need to do is to take all the numbers from (n) series,addition them and then divide them with 9.I’m not sure how to do that in one line…Any help would be appreciated!
1 Answer