Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ 1. Write a program which will play Rock, Paper, Scissors game with the user. When game starts, user will input, O for Rock 1

image text in transcribed
c++
1. Write a program which will play "Rock, Paper, Scissors" game with the user. When game starts, user will input, O for Rock 1 for Paper 2 for Scissors. Rules for the game: 1. Paper wins over Rock. 2. Rock wins over Scissors. 3. Scissors wins over Paper. 4. If both computer and user pick the same move, it will be a draw and no new points will be given to any player. 5. If one player (computer or user) wins the round, 1 point will be given to winner. 6. The player who reaches to maximum score (can be defined inside the program), will win the game. Requirements: If user inputs an illegal value, program should warn and ask input again. Computer's move should be represented with enumeration which has name Move and constants as ROCK, PAPER and SCISSORS. Computer's move should be picked in a separate function which has a function prototype as enum Move getRandomMove (); Commands or methods which are not covered in the class up to this week will not be accepted or graded Sample flow of the game: ****** Welcome to Rock-Paper-Scissors Game ****** ### Rules: ### Press 1 for Rock ### Press 2 for Paper ### Press 3 for Scissors ### First one to reach 3 points will win. Input your move: 1 You picked Rock. Computer picked Scissors. You got 1 point(s). *** Score -> You: 1, Computer: 0 Input your move: 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

LO5 Highlight five external recruiting sources.

Answered: 1 week ago