/** A class to demonstrate operators.  
 * Not intended to do anything
 * @author Nancy Harris
 * @version 01/07/2008
 */
public class Operator
{
	/** A function to demonstrate operators.
	 * @param abc Command line arguments unused in this application
	 */
	public static void main (String [] abc)
	{
		final double INTEREST_RATE = .05;
		
		double dResult;
		double dValue;
		double iResult;
		
		int i1;
		int i2; 
		  	
		boolean flag; 
		boolean bResult;
		
		char letter; 
		char code; 
		char cResult;
		
		String message; 
		String sResult;
		
		i1 = 5; 
		i2 = 2;
		dValue = 45.98;
		flag = false;
		letter = 'z';
		code = 'X';
		message = "A simple message";
		
		// What is the result of the following operations?
		
		iResult = i1 + i2;
		iResult = i1 - i2;
		iResult = i1 / i2;
		iResult = i1 % i2;
		
		iResult = (int)((double) i1 / i2);
		dResult = (double) i1 / i2;
		
		// Will these work?
		iResult = i1 + dValue;
		iResult += i1 + dValue;
		
		++i1;
		i1++;
		
		iResult = i1++;  // what value goes into iResult?
		iResult = ++i1;  // "
		
		iResult = ++i1 + i2; // "
		
		
		i2++;  // what value is in i2?
		
		flag = dValue < INTEREST_RATE;
		flag = !flag;
		flag = (dValue < INTEREST_RATE) && !(flag);	
		
		iResult = i1 + i2 * 5 / 3;  // which operation comes first, second?
											 // use parentheses and then you are sure
		
		bResult = i1 < 5;
		
		// is this legal?
		i1 = i2 = 7;
		
		// is this legal?
		bResult = i1 = 5;	
		bResult = i1 == 5;
		bResult = flag = i1 == 5;		
	}
}
		