CS 1401, Quiz 9

Date: Monday, March 17, 2008
Name (please type legibly, ideally in block letters): ______________________________________________________________________
1. Mark what new material is covered and what is not covered in Chapter 9:

2-4. Today is St. Patrick's Day, which is officially recognized as the Day of the Engineer. Today, you will hear a lot of yelling and celebrations by new students who decided to become True Miners.

2. Define a class Miner whose elements are students who have decided to become True Miners. Each student is characterized by his or her name, major, and the number of times in a row this student can yell the Miners' fighting song. Your class should contain a constructor method, accessor methods, mutator methods, and a method for computing the total yelling time (assume that it takes 2 minutes to yell a song once).

3. Use your class in the main method to define a new Miner (you) with the ability to yell the song 5 times in a row. Then, suppose that you practiced, and you can now yell the song 10 times. Show how to increase this number of times. Compute and print the new yelling time.

4. Trace your program step-by-step.