Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions