//Trevor Potter
// Nov. 11,2014
import java.util.*;
public class student
{
public static void main (String [] args)
{
int[] student= new int [20];
int[] exam1= new int[20];
int[] exam2= new int[20];
int[] exam3= new int[20];
int[] avg= new int[20];
int i=0;
Scanner input = new Scanner(System.in);
for(i=0; i<=19; i++){
System.out.println(" Enter grade for student:" + student[i]+ "(exam1, exam2, exam3)");
exam1[i]=input.nextInt();
exam2[i]=input.nextInt();
exam3[i]=input.nextInt();
avg[i] = (exam1[i]+exam2[i]+exam3[i])/3;
}
System.out.println(" ");
System.out.println("Student Exam1 Exam2 Exam3 Average");
for(i=0; i<=19; i++)
{
System.out.println(student[i]+" "+exam1[i]+" "+exam2[i]+" "+exam3[i]+" "+avg[i]);
}
}// end of class
}// end of main
Trevor_4 0 Newbie Poster
JorgeM 958 Problem Solver Team Colleague Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Trevor_4 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.