Question: CSC100AA and CIS162AA Chapter 5 : Looping Ch 5 Program 1 Factorial Factorial.cpp (10 points) Write a program that computes the factorial of a number
CSC100AA and CIS162AA Chapter 5 : Looping Ch 5 Program 1 Factorial Factorial.cpp (10 points) Write 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 6! Prompt the user for the numeric input between 1 and 10. Do not accept numbers greater than 10 or less than 0. Calculate and display the factorial. All code must reside in the main(). Keep prompting the user for values until a 0 is entered. If a 0 is entered, then quit the program. Include output from this Test Data : 22 7 0 Example Output from data other than the Test Data. Calculating a Factorial Enter a value between 1 and 10. (0 to quit): 4 ------------------ 4! = 24 Enter a value between 1 and 10 . (0 to quit): 7 ------------------ 7! = 5040 Enter a value between 1 and 10 . (0 to quit): 23 The value is out of range. Please re-enter a value between 1 and 10. (0 to quit): 0 Goodbye! Press any key to continue . . .
Rubric
Ch 5 Program 1 : Factorial Rubric (1)
| Criteria | Ratings | Pts | |||
|---|---|---|---|---|---|
| This criterion is linked to a Learning OutcomeComplete Comment Header at top of code |
| 1 pts | |||
| This criterion is linked to a Learning OutcomeFactorial Calculation is correct. |
| 2 pts | |||
| This criterion is linked to a Learning OutcomeRange checking is correct. 0 - 10 allowed. |
| 2 pts | |||
| This criterion is linked to a Learning OutcomeKeeps prompting user for values until a 0 is entered. |
| 2 pts | |||
| This criterion is linked to a Learning OutcomeWhen user enters a 0, program exits cleanly. It does not calculate/display a factorial for 0 or other inconsistent messages. When user enters a 0, program exits cleanly. It does not calculate/display a factorial for 0 or other inconsistent messages. |
| 2 pts | |||
| This criterion is linked to a Learning OutcomeExample output of Test Data included in source code. |
| 1 pts | |||
| Total Points: 10 | |||||
PreviousNext
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
