Activity 5
– Factorials
Write a Java applet that works out the factorial
of 50.
A factorial is an important concept in some branches of mathematics; the factorial of a
particular number is calculated by multiplying all the whole numbers up to and including
the number itself.
For example, the factorial of 10 is calculated as 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1.
In your applet, however, you should use a loop to
calculate the factorial.
You should be able to get the answer in about 8 lines of Java
Discussion/Suggested solution to Activity 5
Back to content
Back
to top

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg |