//Quiz
public class Student {
// main method begins execution of Java application
public static void main( String args[] )
{
Student student1 = new Student();
Student student2 = new Student();
Student student3 = new Student();
Scanner input = new Scanner( System.in );
String first;
String last;
int quiz1;
int quiz2;
int quiz3;
System.out.print( "Enter the first name of the first Student: " );
first = input.nextString();
student1.setfirstName( first );
System.out.print( "Enter the last name of the first student: " );
last = input.nextString();
student1.setlastName( last );
System.out.print( "Enter the grade of quiz1 for the first student: " );
quiz1 = input.nextInt();
student1.setfirstGrade( quiz1 );
System.out.print( "Enter the grade of quiz2 for the first student: " );
quiz2 = input.nextInt();
student1.setsecondGrade( quiz2 );
System.out.print( "Enter the grade of quiz3 for the first student: " );
quiz3 = input.nextInt();
student1.setthirdGrade( quiz3 );
System.out.print( "Enter the first name of the second student: " );
first = input.nextString();
student2.setfirstName( first );
System.out.print( "Enter the last name of the second student: " );
last = input.nextString();
student2.setlastName( last );
System.out.print( "Enter the grade of quiz1 for the second student: " );
quiz1 = input.nextInt();
student2.setfirstGrade( quiz1 );
System.out.print( "Enter the grade of quiz2 for the second student: " );
quiz2 = input.nextInt();
student2.setsecondGrade( quiz2 );
System.out.print( "Enter the grade of quiz3 for the second student: " );
quiz3 = input.nextInt();
student2.setthirdGrade( quiz3 );
System.out.print( "Enter the first name of the third student: " );
first = input.nextString();
student3.setfirstName( first );
System.out.print( "Enter the last name of the third student: " );
last = input.nextString();
student3.setlastName( last );
System.out.print( "Enter the grade of quiz1 for the third student: " );
quiz1 = input.nextInt();
student3.setfirstGrade( quiz1 );
System.out.print( "Enter the grade of quiz2 for the third student: " );
quiz2 = input.nextInt();
student3.setsecondGrade( quiz2 );
System.out.print( "Enter the grade of quiz3 for the third student: " );
quiz3 = input.nextInt();
student3.setthirdGrade( quiz3 );
//displays employee's salary and full name.
System.out.printf( "Now displaying students full names and
grades.\n");
System.out.printf( student1.getfirstName()," ", student1.getlastName(),
" ", student1.getfirstGrade()," " student1.getsecondGrade(), " " student1.getthirdGrade()," " (quiz1+quiz+quiz3)/3, "Average: \n" );
System.out.printf( student2.getfirstName()," ", student2.getlastName()," ", student2.getfirstGrade()," " student2.getsecondGrade(), " " student2.getthirdGrade()," " (quiz1+quiz+quiz3)/3, "Average: \n" );
System.out.printf( student3.getfirstName()," ", student3.getlastName()," ", student3.getfirstGrade()," " student3.getsecondGrade(), " " student3.getthirdGrade()," " (quiz1+quiz+quiz3)/3, "Average: \n" );
}
}//end main