
Untitled
By: a guest on
Jan 8th, 2013 | syntax:
Java | size: 1.37 KB | hits: 34 | expires: Never
import java.util.Scanner;
/**
* Write a description of class StudentDriver here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class StudentDriver
{
public static void main(String[] args)
{
Scanner reader = new Scanner(System.in);
Student student1 = new Student();
Student student2 = new Student();
Student student3 = new Student();
System.out.print("What is your name? ");
String name = reader.nextLine();
student1.setName(name);
System.out.print("What are three numerical grades?: ");
int t1 = reader.nextInt();
student1.setGrade(t1);
// REFERENCES THE STUDENT CLASS
student2.setName("Snarfam the Wizard");
student2.setGrade(99, 56, 84);
student3.setName("Stefan Howansky");
student3.setGrade(73, 78, 81);
System.out.println(student1.toString());
System.out.println("\n" + student2.toString());
System.out.println(" ");
System.out.println(" ");
System.out.println("Is student 1 the same as student 2?:" + "\n" + student1.compareStudent(student2));
System.out.println("Is student 1 the same as student 3?:" + "\n" + student1.compareStudent(student3));
}
}