public class Person{
	public void eat() {System.out.println("Yummy!");}
	public void speak() {System.out.println("Hello");}
	public void sleep() {System.out.println("ZZZZZ");}
}

public class Student extends Person {
	public void speak() {System.out.println("I love school");}
	public void study() {System.out.println("Studying is FUN-damental");}
}

public class Teacher extends Person {
	public void speak() {System.out.println("Do your Homework");}
}

public class ApcsStudent extends Student {
	public void speak() {System.out.println("I love APCS");}
	public void sleep() {System.out.println("ZZZ...inheritance...ZZZ");}
	
	public void getReadyForAPTest() 
	{
		study();
		eat();
		sleep();	
	}
}


public static void main(String[] args) {
	Person p = new Person();
	Student s = new Student();
	Teacher t = new Teacher();
	ApcsStudent a = new ApcsStudent();

	//0. next to each of the following lines, write what will be printed out.
	//if an error would have been generated, write ERROR
	p.speak();
	s.speak();
	t.speak();
	a.speak();
	
	p.eat();
	s.eat();
	t.eat();
	a.eat();
	
	p.sleep();
	s.sleep();
	t.sleep();
	a.sleep();
	
	p.study();
	s.study();
	t.study();
	a.study();
	
	a.getReadyForTest();
	
	//1. what will be printed out after the for loop executes?
	Person[] people = new Person[4];
	people[0] = p;
	people[1] = s;
	people[2] = t;
	people[3] = a;
	for (int i = 0; i < people.length; i++)
		people[i].speak();	
}