// this MUST be the first line
import javax.swing.JOptionPane;
public class factorial extends Object
{
public static void calculatefactorial () {
String s =
JOptionPane.showInputDialog("Enter in the number: ");
int enterednum =
Integer.parseInt(s);
int result = 1;
for (int counter = 1;
counter <= enterednum; counter++) {
result = result *
counter;
}
JOptionPane.showMessageDialog(null, "" + result);
}
}