Question: Instructions Write a class called Factorial to finish the following task. Compile and run the program. Next create a folder and name it with the

 Instructions Write a class called Factorial to finish the following task.

Instructions Write a class called Factorial to finish the following task. Compile and run the program. Next create a folder and name it with the course, section, lab number, and your name. Example: csit111_02_lab jane. Copy Factorial.java to this folder. Last, zip the folder and submit it to Canvas before the given deadline for grading Background The the factorial of an integer n is the product of all numbers from 1 to n and is written n So 5!-5*4*3 * 21 120 By definition, 0 Specifications Write a program that asks the user for an integer. If the integer is greater than or equal to 0, the program calculates the factorial of that number and prints that value. If the number entered is negative, the program prints an error message and quits main Method The main method must create a Scanner object, ask the user for an integer, and use the Scanner object to get a input from the user. If the input is negative, an error message is printed. If the input is not negative, the main method should call the factorial method to get the factorial of the integer entered by the user. And print the value returned by the factorial method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!