/**
* class workWithStudents creates student objects.
* Replace the comments with code. Compile as you go.
*
* @author pepper
* @version 4/14/07
*/
import java.util.Scanner;
public class workWithStudents
{

public static void main (String[] args)
{

Scanner myTerm = new Scanner(System.in);
System.out.println ("Person 1 what is your first and last name?");
String first = myTerm.next();
String last = myTerm.next();
System.out.println ("What is your age?");
int age = myTerm.nextInt();
// Create a new instance of the Student class with these values
Student myStudent1 = new Student(first,last,age);
// Use the Student's toString method to pring out all the values
System.out.println(myStudent1);
// create another student named john doe age 15
Student myJohnDoe = new Student("John","Doe",15);
// print both students:
System.out.println("I will now print the second student");
System.out.println(myJohnDoe);
System.out.println("I will now print the first student");
System.out.println(myStudent1);
//print the first and last names of both students:
myStudent1.printStudentName();
myJohnDoe.printStudentName();
// compare the ages of the two students
int ageComparison = myJohnDoe.compareAge(myStudent1.getAge());
if (ageComparison == -1)
System.out.println ("John is youngest");
else if (ageComparison == 1)
System.out.println ("my student is youngest");
else
System.out.println ("they are the same age");

// now you try it:
System.out.println ("Student 3 what is your first and last name?");
first = myTerm.next();
last = myTerm.next();
System.out.println ("What is your age?");
age = myTerm.nextInt();
// Ex1. create a new instance of the Student class with these values
// Ex2. use the Student's printStudent method to pring out all the values
// Ex3. reprint all the students - there are now 3 - using toString
// Ex3a. print all the student names without ages using printStudentName


// now try a little more complicated
System.out.println ("Student 4 what is your first and last name?");
first = myTerm.next();
last = myTerm.next();
System.out.println ("What is your age?");
age = myTerm.nextInt();
// Ex4. create a new instance of the Student class with these values
// Ex5. use the Student's toString method to pring out all the values
System.out.println ("Now tell me your real age?");
age = myTerm.nextInt();
// Ex6. print out the student using the toString once more
// to see that the student's age didn't change.
// Ex7. compare the age just entered to the student's age using compareAge
// if it returns -1, print, you got older
// if it returns 1, print you got younger
// if it returns 0, print you stayed the same
// Ex8. update the student's age using updateAge
// Print "I just updated your age to " and age.
// Ex9. print the student using toString again
// Ex10. print a message saying you will print all the students
// Ex11. print all the students using toString

// Ex 12. now, go back and fill in the missing methods in student
// of getFirst, getLast, getAge and updateStudentName
// Then, use them to ask person 4 their new name and update it, and
// then print just the first name of all the students you have.
}

}