Computer Science 121
Assignment 1
Due: February 4, 2004

For this assignment, you are to write a Java program that describes a student, in this case yourself.  You should model it after the programs that describe People and CityTemperatures.  The program should have two classes, one that describes the student and the other that contains the main method that runs the program.

The class that describes the student should provide a name for the student, the student’s e-mail address, and student’s year of birth.  The name and e-mail address should be Strings and the year an integer.  The program should display on the screen the student's name, e-mail address and year of birth.

In the constructor, supply your own name for the name, your own e-mail address for the e-mail address and the year you were born.

You are to hand in a print out of the program and a disk that contains the java and class files.  Make sure that your program is working before you hand it in.  Write your name in large letters in the upper right corner of the printout.  Also label your disk with your name and the course number.

// Computer Science 121
// Java application written by <Name>.
// <Date>

// An application with a class that provides information about a person.
class People
{
     public static void main (String [] args)
     {
          Person girl = new Person ();
          girl.displayAge ();
     } // main method
} // class People
 
// Class that stores information about a person's name and age.
class Person
{
     private String name;
     private int age;
 
     // Constructor method that initializes person.
     public Person ()
     {
          name = "Alice";
          age = 7;
     } // constructor
 
     // Method that displays the name and age of a person.
     public void displayAge ()
     {
          System.out.println (name + "'s age is " + age);
     } // method displayAge
} // class Person