Question: please use iostream cstdlib ctime to creat a program that will play rock paper scissors with you.thanks One Round of Rock, Paper, Seissors This week

 please use iostream cstdlib ctime to creat a program that willplease use iostream cstdlib ctime to creat a program that will play rock paper scissors with you.thanks
play rock paper scissors with you.thanks One Round of Rock, Paper, Seissors

One Round of Rock, Paper, Seissors This week you will be working by yourself or with a partner to game with a computer opponent. Generating Random NumbeES We can generate a random number using two C++ libraries: #include //Random number generator (among other things) #include //we will use the current time as a seed When asked for a value, the random number generator will return a pseudo-random number between o and RAND MAX (defined in cstdlib) On value into a smaller set of values, we can use the modulo operator (8) Observe the following pattern: our random 12 % 3-0 14 % 3 2 we count up, the sequence of modulo results repeats from to the 3%3 0 483 1 5% 2 6%3-0 10 % 1 11 3-2 2%3=2 right hand operand of the modulo 1 One feature of the random number generator is that it will always give you the same sequence of values when called. It uses a seed value to determine what sequence of numbers it should create. Ideally, we would want to set our seed to a random value,but in order to do that we would need a random value. The next best thing is to use a value that is always changing, the current time. srand (time (0))/set the seed to the current time If not set, the random number generator will use 1 as its seed. To generator a value, we wil1 use the rand) function from . 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!