Question: Project One IN PYTHON PYTHON PYTHON PYTHON Objectives: incorporate decision-making structures into our code implementing iteration apply nested structures Write a program that plays rock,

Project One IN PYTHON

PYTHON

PYTHON

PYTHON

Objectives:

incorporate decision-making structures into our code

implementing iteration

apply nested structures

Write a program that plays rock, paper, scissors. This is an interactive game between two players. The sample run provided below represents the user interaction and the output displayed.

Important Notes:

Your code will use decision-making, nested structures.

Both upper- and lower-case letters should be considered.

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.

Incorporate an iteration method that allows the user to play again, as many times as they like.

Your code must demonstrate at least 1 method from the String class

Sample output:

Test case 1: [NOT A TIE]

Lets play Rock, Paper, Scissors.

Player 1, Enter your choice: r

Player 2, Enter your choice: p

Rock v. Paper

Player 2 wins

again? y

Player 1, Enter your choice: P

Player 2, Enter your choice: S

Paper v. Scissors

Player 2 wins

again? Y

Player 1, Enter your choice: R

Player 2, Enter your choice: s

Rock v. Scissors

Player 1 wins

again? N

Nice game!

Test case 2: [TIE]

Lets play Rock, Paper, Scissors.

Player 1, Enter your choice: R

Player 2, Enter your choice: R

Rock v. Rock

It's a TIE

again? y

Player 1, Enter your choice: p

Player 2, Enter your choice: p

Paper v. Paper

It's a TIE

again? n

Nice game!

Test case 3: [INVALID CHOICE]

Lets play Rock, Paper, Scissors.

Player 1, Enter your choice: p

Player 2, Enter your choice: w

Paper v. [ERROR: w not a valid move.]

again? y

Player 1, Enter your choice: m

[ERROR: m not a valid move.]

again? n

Nice game!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!