/**
* Student Class: describes a student and compares ages
*
* @author pepper
* @version 4/14/07
*/
public class Student
{
private String first;
private String last;
private int age;

/**
* Constructor for objects of class student
* @param String first name
* @param String last name
* @param int age
*/
/**
* Constructor for objects of class student with
* no parameters creates an empty student
*/
public Student()
{
this.first = "";
this.last = "";
this.age = 0;
}

public Student(String firstIn, String lastIn, int ageIn)
{
// initialise instance variables
this.first = firstIn;
this.last = lastIn;
this.age = ageIn;
}

/**
* toString- make a string with all the student values
*
* @param none
* @return none
*/
public String toString ()
{
return "Student:"+ first + " " + last +
" is " + age + " years old";
}

/**
* printStudentName - print the student first and last name
*
* @param none
* @return none
*/
public void printStudentName ()
{
System.out.println ("The name is "+ first + " " + last);
}
/**
* compareAge - compare the age of the current student to an age parameter
*
* @param int Age
* @return int comparison
* -1 = this instance is younger
* 1 = this instance is older
* 0 = they are the same
*/
public int compareAge (int ageIn)
{
if (this.age < ageIn)
return -1;
else if (this.age == ageIn)
return 0;
else
return 1;
}
/**
* updateAge - update the student age
*
* @param int Age
* @return nothing
*/
public void updateAge (int ageIn)
{
this.age = ageIn;
}
/**
* updateStudentName - update the student name
*
* @param String first name
* @param String last name
* @return nothing
*/
public void updateStudentName (String firstIn, String lastIn)
{
// Exercise #1: write this method to set the value of this instance's first name
// to the value being passed as firstIn and the same for the last name.
}
/**
* getFirst - view the first name
*
* @param nothing
* @return String first
*/
public String getFirst ()
{
// Exercise #2: write this method to return the first name of this instance
return "x";
}
/**
* getLast - view the last name
*
* @param nothing
* @return String last
*/
public String getLast ()
{
// Exercise #3 write this method to return the last name of this instance
return "x";
}
/**
* getAge - view the age
*
* @param nothing
* @return int Age
*/
public int getAge ()
{
return this.age;
}
}