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

Write a program to play the paper-rock-scissors game asfollows. First, the user

ID: 3617366 • Letter: W

Question

Write a program to play the paper-rock-scissors game asfollows. First, the user will ener his or her choise(P,R,or S) fromthe keyboard. Next, the computer will determine its choice bygenerating a random interger between 1 and 3 and using thisinterger to select a P,R, or S. Finally, the program will announcesthe winner as well as the basis for determining the winner. Papercovers rock,rock break scissors, scissors cut paper, or nobodywins. Your program should indicate a while loop that lets the userplay again until the user says she or ge is done. The random interger should be generated using the rand() andscrand() funstions. First use rand() without calling the scrandfunctions.First use rand() without caling the scrand function toset the starting seed. See ehat happenes when you play against thecomputer a few times. When that works correctly, include a call toscrand() so a different starting seed can be chosen each time. Nowplay the game again to see how the computer performs. you candetermine the starting seed by asking the user to enter it or byusing the time (NULL) function which returns the number of seconds(an interger) that have elasped since some time in past (you musthave #include<ctime> in your program). Note. g++ compiler. Write a program to play the paper-rock-scissors game asfollows. First, the user will ener his or her choise(P,R,or S) fromthe keyboard. Next, the computer will determine its choice bygenerating a random interger between 1 and 3 and using thisinterger to select a P,R, or S. Finally, the program will announcesthe winner as well as the basis for determining the winner. Papercovers rock,rock break scissors, scissors cut paper, or nobodywins. Your program should indicate a while loop that lets the userplay again until the user says she or ge is done. The random interger should be generated using the rand() andscrand() funstions. First use rand() without calling the scrandfunctions.First use rand() without caling the scrand function toset the starting seed. See ehat happenes when you play against thecomputer a few times. When that works correctly, include a call toscrand() so a different starting seed can be chosen each time. Nowplay the game again to see how the computer performs. you candetermine the starting seed by asking the user to enter it or byusing the time (NULL) function which returns the number of seconds(an interger) that have elasped since some time in past (you musthave #include<ctime> in your program). Note. g++ compiler.

Explanation / Answer

please rate - thanks the call to srand is commented out. add it when you'reready #include #include #include using namespace std; string moves[3]={"ROCK","PAPER","SISSORS"}; void computer(int &); void user(int &); void score(int ,int); bool conclusion(); int main() { bool again=true; // srand(time(0)); int usermove; int computermove; while(again)    { user(usermove);      computer(computermove);      score(usermove,computermove);      again=conclusion();      } return 0; } void user(int &move) {char a;     couta;     a=tolower(a);    while(a!='r'&&a!='p'&&a!='s')      {couta;      a=tolower(a);      }      switch(a)        {case 'r': move=0;                  break;         case 'p': move=1;                  break;         case 's': move=2;                  break;         }   return ; } void computer(int &move) {move=rand()%3; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote