Question
Java Factorial Problem. Create a package named factorial and write a program to compute the Factorial Function using a loop and print out the results.
Java Factorial Problem. Create a package named factorial and write a program to compute the Factorial Function using a loop and print out the results. Note that the user can continue computing factorials because you will have an outer while loop which will continue executing as long as the user responds with a 'y' to the "Do you want to continue" question. The Factorial function is : Factorial(N) = N * (N-1) * (N-2) .... * 1 Sample output should look like:
Enter in N: 3
Factorial = 6
Do you want to continue? (y/n): y
Enter in N: 4
Factorial = 24
Do you want to continue? (y/n): y
Enter in N: 6
Factorial = 720
Do you want to continue?: (y/n): n
Have a good day
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started