Menu

(Solved) : Exercise 1 Factorial N Denoted N Defined N 12 3 N N 1 4 1 2 3 4 24 6 1 2 3 45 6 720 Write Q30163105 . . .

Using C++
Task 2
Exercise 1. The factorial of n, denoted n!, is defined as: n! 12*3*....*n for n>1 So 4!1*2*3*4 -24 and 6!1 2*3*45*6 720 Write an algorithm (pseudocode) to do the following: . prompt user to input an integer number n 0) calculate the factorial of the number entered . output the result to standard output device Exeraise 2. Create a flowchart for your algonithm using Raptor and verify it for the example cases listed above. Exerase 3. Modify your flowchart of Exercise 2 to valid the input using a loop that repeatedly prompts the user to enter a valid input (Le, a number greater or equal to 0- Exerise 4. Wr Demo your program to your instructor. Copy and paste your flowchart below for submission to the EOL drp upon completion of your lab. Task 2: Working with counter-controlled while loops Exercise 1. Write an algorithm (pseudocode) to read a set of sales data items from standard input nite a C++program for the flowchart of Exercise 3. and calculate and output their total and their average. Prompt user to enter number of data items. Exercise 2. Create a test data set to verify your algorithm. How many cases are needed? Explain. Write your test data set below for submission to the EOL dropbox upon completion of your lab Number of List data items tems Expected output Case 1: Exercise 3. Create a flowchart for your algorithm on Raptor and verify it using your test data. Copy and paste your flowchart below for submission to the EOL dropbox upon completion of your lab. Exercise 4. Write a C++program that implements your flowchart. Use a do-while loop for input validation and a for loop to calculate the total (You may skip this exercise until we cover for and do-while loops) Demo your program to your instructor..Exercise 1. The factorial of n, denoted n!, is defined as: n! 12*3*….*n for n>1 So 4!1*2*3*4 -24 and 6!1 2*3*45*6 720 Write an algorithm (pseudocode) to do the following: . prompt user to input an integer number n 0) calculate the factorial of the number entered . output the result to standard output device Exeraise 2. Create a flowchart for your algonithm using Raptor and verify it for the example cases listed above. Exerase 3. Modify your flowchart of Exercise 2 to valid the input using a loop that repeatedly prompts the user to enter a valid input (Le, a number greater or equal to 0- Exerise 4. Wr Demo your program to your instructor. Copy and paste your flowchart below for submission to the EOL drp upon completion of your lab. Task 2: Working with counter-controlled while loops Exercise 1. Write an algorithm (pseudocode) to read a set of sales data items from standard input nite a C++program for the flowchart of Exercise 3. and calculate and output their total and their average. Prompt user to enter number of data items. Exercise 2. Create a test data set to verify your algorithm. How many cases are needed? Explain. Write your test data set below for submission to the EOL dropbox upon completion of your lab Number of List data items tems Expected output Case 1: Exercise 3. Create a flowchart for your algorithm on Raptor and verify it using your test data. Copy and paste your flowchart below for submission to the EOL dropbox upon completion of your lab. Exercise 4. Write a C++program that implements your flowchart. Use a do-while loop for input validation and a for loop to calculate the total (You may skip this exercise until we cover for and do-while loops) Demo your program to your instructor.. Show transcribed image text

Expert Answer


Answer to Exercise 1 Factorial N Denoted N Defined N 12 3 N N 1 4 1 2 3 4 24 6 1 2 3 45 6 720 Write Q30163105 . . .

OR