Question: Implement a function getRandomNum(int min, int max) that takes two arguments, a min and a max integer. The function returns an integer which is a

Implement a function getRandomNum(int min, int max) that takes two arguments, a min and a max integer. The function returns an integer which is a random number between minimum (including minimum) and maximum (excluding maximum).

Ask the user to enter four integers and call the function twice. Multiply the result together and print out the result to the screen.

You can assume the seed is set to the integer 1.

Template for input/output

Enter first minimum number:

Enter first maximum number:

Enter second minimum number:

Enter second maximum number:

* =

Sample input/output (bolded is input, which do not show up on ZyBooks)

Enter first minimum number: 0

Enter first maximum number: 6

Enter second minimum number: 0

Enter second maximum number: 6

1 * 4 = 4

Implement a function getRandomNum(int min, int max) that takes two arguments, a

My output keeps coming out wrong? Need help here

min and a max integer. The function returns an integer which is

include kiostream 2 #include 3 #include 4 using namespace std. 5 int getRandomNum (int min, int max) 6 int getRandomNum (int min, int max) int seedVal 10 time t t 12 seedVal (unsigned) time (&t) 13 grand (seed Val) 14 15 16 return rand max+min; 17 18 int main 19 20 21 int mln. fmax, smin smax, random number 1 r random number2 22 23 24 Cout>fmin; 26 27 28 Cout>fmax; 30 31 32 random number 1XgetRandomNum (fmin fmax) 33 34 35 Cout 8min. 37 38 39 Cout Smax; 41 42 43 random number getRandomNum (smin, smax) 44 45 46 cout

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!