Define a MoreMath class that has a factorial method that takes an integer and returns the factorial of that integer. Make this method a class method by using the keyword static in the method declaration after the public keyword.

What will be an ideal response?

```
/¤¤
¤ Clas s f o r more mathemat ical f u n c t i o n s
¤ @author Barb Er icson
¤/
public clas s MoreMath
f
/**
* Method to c a l c u l a t e the f a c t o r i a l of a number
* @param the number to use in the c a l c u l a t i o n
* @return the f a c t o r i a l of the number
*/
public static intfactorial ( int n)
{
i f (n == 0)
return 1 ;
else
return n * factorial (n-1);
}
}
```

Computer Science & Information Technology

You might also like to view...

Which of the following would NOT be considered an advantage of e-mail as compared to regular postal mail?

A) speed B) technical difficulties C) remote accessibility D) cost

Computer Science & Information Technology

The OS X file system uses ________

A) DoS B) HFS+ C) FAT D) NTFS

Computer Science & Information Technology