/* @(#)Factorial.java 1.0  04 October 2004 */
/* By Jake Dreier and Sarah House*/

/* Useful imports */

import edu.neu.ccs.*;
import edu.neu.ccs.gui.*;
import edu.neu.ccs.codec.*;
import edu.neu.ccs.console.*;
import edu.neu.ccs.filter.*;
import edu.neu.ccs.jpf.*;
import edu.neu.ccs.parser.*;
import edu.neu.ccs.pedagogy.*;
import edu.neu.ccs.quick.*;
import edu.neu.ccs.util.*;

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.font.*;
import java.awt.image.*;
import javax.swing.*;
import javax.swing.border.*;
import java.io.*;
import java.util.*;
import java.math.*;
import java.beans.*;
import java.lang.reflect.*;
import java.net.URL;
import java.util.regex.*;

// import java.text.*;

public class FactorialTester extends JPF 
{
    
    public static void main(String[] args) { 
        // To optionally adjust the look and feel,
        // remove the comments from one of the two statements below.
        
        // LookAndFeelTools.showSelectLookAndFeelDialog();
        // LookAndFeelTools.adjustAllDefaultFontSizes(2);
        
        new FactorialTester();
    }
    /** Evaluate the factorial in an automatically generated GUI. */
    public int factorial(int x) {
    	int y = 1;
    	while( x > 0){
    		y = (x * y);
    		x--;
    		}
    	return y;
	}
	
	/** Evaluate one factorial in the console */
	public void fact_in_console() {
	int x = console.in.demandInt("Enter an integer:");
	x = factorial(x);
	console.out.println("Result = " + x);
	}
}


