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?

```
/? ?
? C l a s s f o r more m a t h e m a t i c a l f u n c t i o n s
? @author Barb E r i c s o n
?/
public c l a s s MoreMath
{
/? ?
? Method t o c a l c u l a t e t h e f a c t o r i a l o f a number
? @param t h e number t o u s e i n t h e c a l c u l a t i o n
? @return t h e f a c t o r i a l o f t h e number
?/
public s t a t i c i n t f a c t o r i a l ( in t n )
{
i f ( n == 0 )
return 1 ;
else
return n ? f a c t o r i a l ( n ?1);
}
}
```

Computer Science & Information Technology

You might also like to view...

If you want to build a form by adding fields one at time or arrange them in a different layout, you should use the ________ tool

A) Blank Form B) Layout C) Control D) Subform

Computer Science & Information Technology

Which Windows program is used to set file attributes?

A) Device Manager B) Task Manager C) Explorer/File Explorer D) Internet Explorer

Computer Science & Information Technology