Below the source code are sample outputs of the rock paper scissorprogram. i am
ID: 3615705 • Letter: B
Question
Below the source code are sample outputs of the rock paper scissorprogram. i am having problems writing the code to look like thesample outputs.#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
using namespace std;
const int NUM_ROUNDS = 10;
const int USER =0;
const int COMPUTER =1;
enum moveT {ROCK,PAPER,SISSORS};
void intro();
void get_computer_move(moveT &move);
void get_user_move(moveT &move);
void update_scores(const moveT &user_move,
const moveT &computer_move,
vector <int> &scores);
void conclusion(vector <int> &scores);
int main()
{
vector <int> scores(2);
scores[USER]=0;
scores[COMPUTER]=0;
moveT computer_move = ROCK;
moveT user_move = ROCK;
intro();
for (int round=0; round<NUM_ROUNDS;round++)
{
get_computer_move(computer_move);
get_user_move(user_move);
update_scores(user_move,computer_move,scores);
}
conclusion(scores);
return 0;
}
void intro()
{
cout<<"This is an exciting no holds barred game of...."<<endl;
cout<<"ROCK .... PAPER .... SISSORS"<<endl;
cout<<"A game of nerves of steel, cunning, office supplies,and a rock."<<endl;
cout<<"The rules are deceptively simple. In each round youmay choose"<<endl;
cout<<"one of three combat objects. Each has unique strengthsand weakness."<<endl;
cout<<"ROCK:"<<endl;
cour<<" powerful and able to smash sissors with asingle blow. Yet with an"<<endl;
cout<<" achillies heal. Rock is outwitted by lowlypaper which can cover it."<<endl;
endl;
cout<<"PAPER:"<<endl;
cout<<" Greatly underated but can outwit the powerfulrock by covering."<<endl;
cout<<" Helpless, against the jaws ofsissors."<<endl;
endl;
cout<<"SISSORS:"<<endl;
cout<<" Feared by paper which it can sred with a singlesnip. Still,"<<endl;
cout<<" must be wary of being smashed byrock."<<endl;
endl;
cout<<"Unbeknowst to you, the computer also chooses a combatobject."<<endl;
cout<<"Each round your choices are simultanously revealed andthe"<<endl;
cout<<"ritual combat is resolved via the ancientprotocal:"<<endl;
cout<<"(1) rock beats sissors"<<endl;
cout<<"(2) sissors beats paper"<<endl;
cout<<"(3) paper beats rock"<<endl;
endl;
cout<<"Now prepare yourself for ROCK! PAPER!SISSORS!"<<endl;
endl;
}
void get_user_move(moveT &move)
{
return;
}
void get_computer_move(moveT &move)
{
return;
}
void update_scores(const moveT &user_move,
const moveT &computer_move,
vector <int> &scores)
{
return;
}
void conclusion(vector <int> &scores)
{
// I would have to display "Computer Wins! Good game. Playagain!"
// or "User Wins! Good game. Play again!
return;
}
/* These are sample outputs of what the program should be
Choose your combat object [r,p,s]: r
I chose rock.
Tie!
Choose your combat object [r,p,s]: r
I chose rock.
Tie!
Choose your combat object [r,p,s]: r
I chose rock.
Tie!
Choose your combat object [r,p,s]: r
I chose rock.
Tie!
Choose your combat object [r,p,s]: r
I chose paper.
I cover your rock. you lose!
Choose your combat object [r,p,s]: r
I chose sissors.
You break my sissors. you win!
Choose your combat object [r,p,s]: r
I chose sissors.
You break my sissors. you win!
Choose your combat object [r,p,s]: r
I chose paper.
I cover your rock. you lose!
Choose your combat object [r,p,s]: r
I chose sissors.
You break my sissors. you win!
Choose your combat object [r,p,s]: r
I chose rock.
Tie!
The final score is:
Computer 2
User 3
User Wins!
Good game. Play again!
OR
Choose your combat object [r,p,s]: r
I chose paper.
I cover your rock. you lose!
Choose your combat object [r,p,s]: R
I chose rock.
Tie!
Choose your combat object [r,p,s]: p
I chose sissors.
I cut your paper. you lose!
Choose your combat object [r,p,s]: p
I chose sissors.
I cut your paper. you lose!
Choose your combat object [r,p,s]: s
I chose rock.
I break your sissors, you lose!
Choose your combat object [r,p,s]: p
I chose sissors.
I cut your paper. you lose!
Choose your combat object [r,p,s]: s
I chose rock.
I break your sissors, you lose!
Choose your combat object [r,p,s]: s
I chose paper.
You cut my paper. you win!
Choose your combat object [r,p,s]: s
I chose rock.
I break your sissors, you lose!
Choose your combat object [r,p,s]: p
I chose paper.
Tie!
The final score is:
Computer 7
User 1
Computer Wins!
Good game. Play again!
*/