Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Develop a program that consists of the following two functions. In the main func

ID: 3544099 • Letter: D

Question



Develop a program that consists of the following two functions. In the main function,
read in data and call these two functions to perform these tasks.

Function 1. The factorial of a positive integer n is the product of the integers from 1 to

n. You can express the factorial of a positive integer n (in mathematics this is denoted by
n !) using the following formula:
n!=1*2 *3* *(n-1)*n

Write a C++ function that will compute the factorial of some numbers n (input from the
user, accept only range 1-8) For each valid number in input, the output should be the
value of n ! . Your program shoirld use a loop, to allow the user to input more than one
number (count-controlled or sqntinel-controlled, your choice).Thus, your program should
consist of two functions, the main function and the function that calculates factorial

sequences.

FunctiOn2.Use nested for loops statements to draw triangles of "*,s-
The number of 'r*'irs on the last row is input from the user (vafid
range: 5 to 21).

Sample dialog:

Drawing triangles program.

How many trlangles? 2
How many stars/fast row (5-2L)? 25
Out of range. Reenter: 7


*
**
***
****
*****
******
*******


How many stars/last row (5-21) ? 5



Explanation / Answer

include #include using namespace std; int calculate (int num); int main() { int number; cout > number; while(number>=1 && number