Question: Using the following example, to build an example by C++, Thank you very much #include #include #include //for using pow(x,y) #include int function1(); int function2();

Using the following example, to build an example by C++, Thank you very much

 Using the following example, to build an example by C++, Thank

#include

#include

#include //for using pow(x,y)

#include

int function1();

int function2();

int main()

{

int funcResult; //holds the result of the int function

funcResult = function2();

printf("Function Result is: %d", funcResult);

return 0;

}

int function1()

{

int randResult; //holds the result of the dice roll

int i = 0;

for(i = 0; i

{

randResult = rand();

randResult = (randResult % 6) + 1;

printf("Dice result is: %d ", randResult);

}

return 0;

}

//Returns a random number between 1 and 6

int function2()

{

int randResult;

randResult = rand(); // gets a random number and saves it to the var

randResult = (randResult % 6) + 1; //gets the result within the wanted range(1-6)

return randResult;

}

Write a program that contains 3 functions built by you(4 including the main). The main function should call those functions in a particular order. AlI 3 functions should return something to the calling function. The 2nd and 3rd functions called should use the output from the previous function. Example 1. int x = 0; 2, x = func1(): 3, x = func2(x); 4, x = func3(x); Each of the three functions you write should call one of the functions you learned today to do something to the input. List of optional functions to call modulo sqrt fabs) ceil) floor pow Appropriate formatting and commentary rules are enforced

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!