Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

I will need to submit: A copy of the Module 4 lab document with answers for the self-test exercises as specified on the lab document. Name this document “yourlastnameSelfTest4” Your completed...

1 answer below »

I will need to submit:

  • A copy of the Module 4 lab document with answers for the self-test exercises as specified on the lab document. Name this document “yourlastnameSelfTest4”
  • Your completed algorithm based on the “RPSAlgorithm” document that I have provided in your module 4 download. Youmustuse this algorithm. Name this document “yourlastnameRPSAlgorithm.docx”
  • The source code for the Rock Paper Scissor program– Name this file “yourlastnameRPS.cpp
  • TEST RUN - Copy the test run output from your program and paste in to the bottom of your source code. Make each line a comment so that all you need to do is submit your source code and your output will be at the bottom of your program.

Rock, Paper, Scissors

Write a program to play and 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 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 uppercase letters. Your program should include a loop that lets the user play again until the user says she or he is done.

Test Run: Refer to the lab sheet

Answered Same Day Sep 29, 2021

Solution

Amar Kumar answered on Sep 29 2021
134 Votes
#import the li
ary function "random" so that you can use it for computer
#choice
import random
#define main
def main():
#assign win, lose, and tie to zero for tallying
win = 0
lose = 0
tie = 0
#control loop with 'y' variable
play_again = 'y'
#start the game
while play_again == 'y':
#make a welcome message and give directions
print('Prepare to battle in a game of paper, rock, scissors!')
print('Please input the co
ect number according')
print('to the object you want to choose.')
#Get the player and computers choices and
#assign them to variables
computer_choice = get_computer_choice()
player_choice = get_player_choice()
#print choices
print('Computer chose', computer_choice, '.')
print('You chose', player_choice, '.')
#determine who won
winner_result(computer_choice, player_choice)
#ask the user if they want to play again
play_again =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here