Lab 4

September 25, 2007
This will be an individual assignment, everyone should do their own work, on your own, etc. etc.

You will take the CashRegister class and manipulate the class to do a few extra things.
First:

New Stuff

This program has a new feature we haven't talked about yet and that's a constant. A constant is a variable that can't be changed anywhere in the program.
The keyword for a constant is final. When you declare a instance field as a final you have to give it a value at the time of declaration and that value can't change throughout the program. Here is one of the constants in this program:

public static final double QUARTER_VALUE = 0.25;


The book also calls them static, but a final doesn't have to be static. For now make sure you use them the same way the book uses them.
The other thing that you should see in a final is the variable name is always in all capital letters. This tells other programmers that the variable is a constant.