Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with the following program C++ : Write a program to score the paper-rock-scissor game. Each of two users types in either P,

I need help with the following program C++:

Write a program to score the paper-rock-scissor game. Each of two users types in either P, R, or S. The program then announces the winner as well as the basis for determining the winner: Paper covers rock, Rock breaks scissors, Scissors cut paper, or Nobody wins. Be sure to allow the users to use lowercase as well as uppercase letters. Your program should include a loop that lets the user play again until the user says she or he is done.

*Please keep in mind I need to use SWITCH STATEMENTS Only!

Output Should Be:

Player 1: R Player 2: S

Player 1 wins

again? Y

Player 1: R Player 2: R

Its a tie

again? Y

Player 1: P Player 2: S

Player 2 wins.

again? N

DO NOT use if / else for this assignment.

Yes, this requires a nested switch statement:

Read player one and player two options: (R, P, or S - both upper and lower case for this and virtually any project you do in my classes.)

Four cases for player 1: R, P, S and never forget the default case. Within each of the first three cases, there are four cases for player two.

"default" should be used as well in the switch statements just in case if the user enters an invalid value.

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

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

ISBN: 978-0764535376

More Books

Students also viewed these Databases questions

Question

What is a break-even point?

Answered: 1 week ago