/**
 *  
 * Class CADAUD takes an amount of money in Canadian dollars 
 * and converts it to Australian dollars.
 *
 * @author  Daniel Burgner
 * @version 1.0
 * @date    03.05.2002
 *
 */
import java.lang.*;

public class CADAUD implements Conversion {

	/* dCADAUDRate is the conversion rate from Canadian dollars 
	   to Australian dollars. */
	protected double dCADAUDRate;

	/**
	 * Calculates the result in either Canadian dollars or
	 * Australian dollars.
	 * @param  dA - The amount of money to be converted.
	 * @param  bF - The flag indicating which conversion.
	 * @return the result of the calculation - a double
	 */
	public double result(double dA, boolean bF) {
		if (bF) {
			return (dCADAUDRate * dA);
		} else {
			return ((1.0 / dCADAUDRate) * dA);
		}
	}

	/**
	 * Creates a new CADAUD object that takes in the
	 * coordinates of the conversion rate and a flag
	 * indicating a CAD or a AUD currency.
	 * @param dR - The conversion rate.
	 */
	public CADAUD(double dR) {
		dCADAUDRate = dR;
	}
}
