For Loop & Longs (50 points)
Write an applet which will determine the factorial of any long. Longs are integers
in the following interval : -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (inclusively).
Display your output with TextArea(8,25). Output all factorials in equation
form with no more than five factors per row. Show the original factoral and answer
on seperate lines. Do not output a "X" symbol after the last factor. If a negative number
is entered, state that the factorial of a negative is undefined. For example,
If 12 is entered, then the output must be :
1 X 2 X 3 X 4 X 5 X
6 X 7 X 8 X 9 X 10 X
11 X 12 =
If 0 is entered, then the output must be :
If -3 or any negative is entered, then the output must be :
The factorial of a
negative is undefined.
- Document your applet. Include your Name, Date, Project#, and a
description of the project.
- Use a for loop to calculate the factorial and a second to display the factors.
- Input the data with the TextField class
- Allow all data input to be of type long.
- Output your report with the appendText method.
Sample Output for Project 37