Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class JavaApplication
- {
- public static void main(String[] args)
- {
- int[] grades = new int[4];
- grades[0] = 77;
- grades[1] = 84;
- grades[2] = 80;
- grades[3] = 96;
- String[] Students = new String[] {"Tom", "Ed", "Joe", "Bob"};
- double sum = 0.0;
- System.out.print("#tStudenttGraden");
- System.out.print("-t-------t-----n");
- int i = 0;
- for(;i<grades.length;i++);
- {
- System.out.printf("%dt%st%dn", i, Students[i], grades[i]);
- sum += grades[i];
- }
- double average = sum / grades.length;
- System.out.printf("Class Average %fn", average);
- }
- }
Add Comment
Please, Sign In to add comment