import com.microfocus.cobol.*;
// OCWIZARD start imports
// OCWIZARD end imports

public class javacalc extends com.microfocus.cobol.RuntimeObject 
{
	/* static methods - the COBOL RuntimeSystem will register these */
	public native static boolean cobinvokestatic_boolean (String methodName, Object[] params)
		throws CobolException, Exception;
	public native static byte cobinvokestatic_byte (String methodName, Object[] params)
		throws CobolException, Exception;
	public native static char cobinvokestatic_char (String methodName, Object[] params)
		throws CobolException, Exception;
	public native static short cobinvokestatic_short (String methodName, Object[] params)
		throws CobolException, Exception;
	public native static int cobinvokestatic_int (String methodName, Object[] params)
		throws CobolException, Exception;
	public native static long cobinvokestatic_long (String methodName, Object[] params)
		throws CobolException, Exception;
	public native static float cobinvokestatic_float (String methodName, Object[] params)
		throws CobolException, Exception;
	public native static double cobinvokestatic_double (String methodName, Object[] params)
		throws CobolException, Exception;
	public native static void cobinvokestatic_void (String methodName, Object[] params)
		throws CobolException, Exception;	
	public native static Object cobinvokestatic_object (String methodName, Object[] params)
		throws CobolException, Exception;

	static private String javaClassName = "javacalc";
	static
	{
		/* Load the class */
		/* cobloadclass (libraryname, cobolname, fulljavaname); */
		cobloadclass ("javacalc", "javacalc", javaClassName);
	}

	// OCWIZARD - start java methods

        public  String calcSimpleInterest (double amount, int years) throws Exception, CobolException
	{
		// Parameters are passed to COBOL in an array
                Double param1 = new Double(amount);
                Integer param2 = new Integer(years);
                Object[] params = {param1, param2};
		return ((String) cobinvoke_object ("calcSimpleInterest", params));
	}

        public  String calcCompoundInterest (double amount, int years) throws Exception, CobolException
	{
		// Parameters are passed to COBOL in an array
                Double param1 = new Double(amount);
                Integer param2 = new Integer(years);
                Object[] params = {param1, param2};
		return ((String) cobinvoke_object ("calcCompoundInterest", params));
	}

	public static void setInterestRate (String rate) throws Exception, CobolException
	{
		// Parameters are passed to COBOL in an array
		Object[] params = {rate};
		cobinvokestatic_void ("setInterestRate", params);
	}

	public static String getInterestRate () throws Exception, CobolException
	{
		// Parameters are passed to COBOL in an array
		Object[] params = {};
		return ((String) cobinvokestatic_object ("getInterestRate", params));
	}
	// OCWIZARD - end java methods
}