Question: help This program will accept a positive integer as the seed for the random number generator. This part of the code has been provided in

help
help This program will accept a positive integer as the seed for
the random number generator. This part of the code has been provided

This program will accept a positive integer as the seed for the random number generator. This part of the code has been provided in the template. You will then use the rand() function to generate a random integer. Find a way to use the modulo (remainder) operator in an arithmetic expression to convert the random integer into a die value (1-6). Your program must generate two unique die values and sum the result which will both be displayed as in the following example. Output (user prompt). Enter a positive integer: Input (user supplied seed) 23 Output You rolled a 3 and for a total of 4. 1 #include 2 //add standard library and time library 3 4 int main() { 5 6 int diel, die2; 7 int seed; 8 9 /* RANDOM NUMBER GENERATOR SEED 10 leave as is when submitting for grading 11 can be set replaced with srand(time(NULL); 12 to make the dice roll differently every time 13 and not dependent upon the user's input. 14 */ 15 printf("Enter a positive integer:"); 16 scanf("%d",&seed); 17 srand(seed); //Set the seed for the random number generator 18 19 //write an expression to generate a value for each die 20 / Add Code Here*/ 21 22 //display the result of the roll 23 /* Add Code Here*/ 24 25 return 0; 263

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!