question archive Factorial

Factorial

Subject:Computer SciencePrice: Bought3

Factorial.java                                                 

Please adhere to the Standards for Programming Assignments and the Java Coding Guidelines.

 

A program that computes the factorial of a number that is input from the user. 

A factorial is the product of all the numbers up to the number entered. 

For example, 6-factorial is 720 because 6*5*4*3*2*1 is 720. 

Six-factorial is written as 6! 

 

Prompt the user for the numeric input between 1 and 10. 

Do not accept numbers greater than 10 or less than 1.

Calculate and display the factorial. All code must reside in the main() method

Range checking is correct. 0 - 10 allowed.

Example output of Test Data included in source code.

The program is documented well, with comments.

 Include output from this Test Data:            22

                                                                       7

                                                                       1

Example Output with Valid inputs:

 

*******Factorial*********

 

Please enter a value between 1-10: 5

 

5! = 120

 

Goodbye!!

 

Example Output with an Invalid input:

*******Factorial*********

 

Please enter a value between 1-10: 12

Value is out of range. Please Re-enter a value between 1-10 :

17

Value is out of range. Please Re-enter a value between 1-10 :

8

8! = 40320

Goodbye!!

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE