Rock-paper-scissors game. Each player iwll enter either a \'p\', \'r\', \'s\'. G
ID: 3616955 • Letter: R
Question
Rock-paper-scissors game. Each player iwll enter either a 'p', 'r', 's'. Get the inputby using a sepaprate function that uses pass-by reference.Determine and display the winner of the game in a separate functionwhich will take in 2 arguments, one for each user, passed by valueto the function. Make the program loop allowing the user to playagain using a sentinel value. MEssages to display : Paper coversrock. Rock breaks scissors. Scissors cut paper, or Nobody wins (ifit's a tie). Rock-paper-scissors game. Each player iwll enter either a 'p', 'r', 's'. Get the inputby using a sepaprate function that uses pass-by reference.Determine and display the winner of the game in a separate functionwhich will take in 2 arguments, one for each user, passed by valueto the function. Make the program loop allowing the user to playagain using a sentinel value. MEssages to display : Paper coversrock. Rock breaks scissors. Scissors cut paper, or Nobody wins (ifit's a tie).Explanation / Answer
please rate - thanks #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; srand(time(0)); int computermove; int usermove; do{ user(usermove); computer(computermove); score(usermove,computermove); again=conclusion(); }while(again); 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; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.