Activity
2 – Factorial class
In an earlier unit you will have written a
program to calculate the factorial of a number — a model answer is Factorial1.java.
Modify this program so that it uses a class
called Factorial to do the calculation. This class should have a method called calculateFactorial() which contains the code to do the calculation itself. In the program's main
class, you should get the answer by executing:
Factorial.calculateFactorial(50);
Discussion/Suggested solution to Activity 2
Back
to content
Back
to top

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