CS 1713 Introduction to Computer Science -- Spring 2001
Practice Problem on Classes

Consider the following Student class (this class is also used below in the practice problem on interfaces):

public class Student {
   private String name; // In the form "LastName, FirstName"
   private double GPA; // grade point average
   private int collegeClass; // 1 = FR, 2 = SO, 3 = JR, 4 = SR, 5 = GR

   public Student(){} // some reasonable constructor

   public double getGPA() {} // return the GPA
   // ...
}
Answer the following questions:
  1. Write a reasonable constructor that has three parameters corresponding to the three data fields.
  2. Write code in a separate class or in a main method that will create student classes with the following data for name, GPA, and collegeClass:
  3. Write code for the getGPA method and show how to invoke it for the first student above (Joe Blow).