Students in School


This program represents a silly model of the students at Duke University, where students work too hard, eat poorly, and eventually die. However, the interesting part about the program is that we can use the same method to simulate a variety of different students even though each type of student is a different class: generic Student, Duke student, and Cosmic student. The School class models the school all students attend and actually runs the simulation.

First, look over the program and predict the output it will produce. Once you are confident that you understand the code, make the following modifications to the program:

  1. Add a new type of student to the simulation. It should at least extend the Student super-class, but may extend one of its sub-classes as well. You decide what methods should it override, or whether it should define its own new methods.
     
  2. Create a collection, i.e., ArrayList, of students and modify main by writing a loop simulate all of the students in your collection by calling the un-modified method goUntilDead.