subject

In C++ programming please.
Rock, Paper, Scissors Game.
a) Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows:
1. When the program begins, a random number in the range of 1 through 3 is generated (1+rand()%3). If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, them the computer has chosen scissors. (Don't display computer's choice yet).
2. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. (You can use a menu if you prefer).
3. The computer's choice is displayed.
4. A winner is selected according to the rock paper scossors game riles.
Be sure to divide the program into the following functions:
int getUserChoice ();
The getUserChoice function displays a menu allowing the user to select rock, paper, or scissors.
4 to Quit the game
The function then returns 1 for rock, or 2 for paper, or 3 for scissors.
User input validation of the choices
int getComputerSchoice ();
The getComputerChoice function returns the computer's game choice.
It returns 1 for rock (via the ROCK constant), or 2 for paper (via the PAPER constant), or 3 for scissors
determineWinner (int, int);
The determineWinner function accepts the user's game choice and the computer's game choice as arguments and displays the choices, and a message indicating the winner.
void displayChoice (int);
The displayChoice function accepts an integer argument and displays rock, paper, or Scissors.
int main ()
Loop while user choice is not 4 (Quit the game)

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:10, passions3534ovf6dt
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
image
Computers and Technology, 23.06.2019 02:50, CrusaderLord
Define a class named movie. include private fields for the title, year, and name of the director. include three public functions withprototypes void movie: : settitle(cstring); , voidmovie: : setyear(int); , void movie: : setdirector(string); . includeanother function that displays all the information about a movie. write a main() function that declares a movie object namedmyfavoritemovie. set and display the object's fields. this is what i have but know its wrong since it will notcompile: #include#includeusing namespace std; //class declarationclass movie{private: string movietitle ; string movieyear; string directorname; public: void settitle(string title); void setyear(string year); void setdirector(string director); void displayinfo(); }; //class implementationvoid movie: : settitle(string title){ movietitle = title; cout< < "what is the title of themovie? "< > temp; myfavoritemovie. settitle(temp); cout< < "enter movie year"< > temp; myfavoritemovie. setyear(temp); cout< < "enter director'sname"< > temp; myfavoritemovie. setdirector(temp); //display all the data myfavoritemovie. displayinfo(); system("pause"); return 0; this code is not entirely mine someone on cramster edited my firstcode but then i try manipulating the new code and i still get acompile error message : \documents\visual studio 2008\projects\movie\movie\movie. cpp(46) : error c2679: binary '< < ' : no operator found which takes aright-hand operand of type 'std: : string' (or there is no acceptableconversion)c: \program files (x86)\microsoft visual studio9.0\vc\include\ostream(653): could be'std: : basic_ostream< _elem,_traits> & std: : operator< < > (std: : basic_ostream< _elem,_traits> & ,const char *)w
Answers: 1
image
Computers and Technology, 23.06.2019 05:00, mikeysoulemison
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
image
Computers and Technology, 23.06.2019 07:00, sugaree95
What are three software programs for mobile computing?
Answers: 1
You know the right answer?
In C++ programming please.
Rock, Paper, Scissors Game.
a) Write a program that lets the...

Questions in other subjects:

Konu
Mathematics, 09.12.2021 19:20
Konu
English, 09.12.2021 19:20
Konu
English, 09.12.2021 19:20