MathMethods Program
Description
MathMethods.java file contains factorial, fibonacci, prime, hypotenuse, and perfect number methods.It doesn't have the main() method, so it cannot be run as a program. But the methods can be called by other programs.
MathProgram.java is a program that calls the methods defined in MathMethods.java file.
***Note: Both source code files should be placed in the same directory.
Associated Concepts:
Calling methods defined in other Java file
Algorithm:
MathMethods.java file contains several methods.
MathProgram.java calls the methods defined in MathMethods.java file.
hypotenuse
factorial
fibonacci
prime
perfectNnumber
factorial
fibonacci
prime
perfectNnumber
MathProgram.java calls the methods defined in MathMethods.java file.
Source Code
MathMethods.java Source CodeMathProgram.java Source Code