/**
 *
 * Class Currency implements a method that shows the 
 * currencies in British pounds, Canadian dollars,  
 * Euros and Australian dollars as converted from
 * US dollars
 *
 * @author  Daniel Burgner
 * @version 1.0
 * @class   CS5730
 * @date    02.15.2002
 */

import java.awt.*;
import java.io.*;
import java.lang.*;
import java.applet.Applet;

public class Currency extends Applet {

	/* MAX_CURRENCIES holds the maximum number of currencies */
	protected static int MAX_CURRENCIES = 4;

	/* nCurrency holds the number of currencies */
	protected int nCurrency;

	/* strCurr holds an array of currency names */
	protected String strCurr[] = new String[MAX_CURRENCIES];

	/* strRate holds an array of currency rates as string
		representations */
	protected String strRate[] = new String[MAX_CURRENCIES];

	/* nAmount holds the amount to be converted */
	protected double dAmount;

	/* font holds the font to be used for the applet */
	protected Font font = new Font("Monospaced", Font.BOLD, 15);

	/**
	 *
	 * init initializes the process by getting the parameters
	 * from the html file.
	 * @param  none
	 * @return void
	 *
	 */
	public void init() {
		String strParam0 = getParameter("NumCurr");
		nCurrency = Integer.parseInt(String.valueOf(strParam0));
		for (int nI = 0; nI < nCurrency; nI++) {
			strCurr[nI] = getParameter("Curr" + (nI + 1) + "Name");
			strRate[nI] = getParameter("Curr" + (nI + 1) + "Rate");
		}
		String strParam1 = getParameter("Amount");
		dAmount = Double.valueOf(strParam1).doubleValue();
		
	}
}
