Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with C++ HW, need to use while loop and if statement. Welcome to the game of Rock/Paper/Scissors where you play against the

I need help with C++ HW, need to use while loop and if statement.

Welcome to the game of Rock/Paper/Scissors where you play against the computer in C++ program. On each move the computer will choose R, P, or S, then the user will be prompted for their choice, and then the score will be updated. P beats R, R beats S, and S beats P. The score starts at 0. Add one if the person wins, subtract one if the computer wins. The game ends if the score reaches -5 or + 5. User input of 'x' or 'X' causes the game to exit.

Option 1: (Computer always chooses R) and: User input of X immediately exits program User input of x (lower case) immediately exits program Program handles both lower and upper case user input (e.g. 'r' and 'R'); also move number increments each move Score updates correctly for all user inputs: r, p, s Option 2: Computer's move is random and: Predetermined input sequence correctly leads to computer win Predetermined input sequence correctly leads to human win Option 3: Correctly displays and updates the graphical score Correctly displays and updates the graphical score, with assessment results hidden

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

Step: 3

blur-text-image

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