Question: Program must be written in python Question 1: ( 50 points) Write a Python program that lets the user play the game of Rock Plastic

Program must be written in python

Question 1: ( 50 points)

Write a Python program that lets the user play the game of Rock Plastic Dragon against the computer.

The program should work as follows:

  1. The user enters his choice of rock, plastic or dragon at the keyboard.

  2. If the user enters a wrong choice ask the user to enter again.

  3. When the program begins a random number is generated as 10 20 or 30. If the number is 10, computer has chosen dragon, if the number is 20 computer has chosen rock and if 30 computer has chosen plastic.

  4. The computers choice is displayed.

  5. A winner is selected according to the following rules.

    1. If one player chooses rock and other player chooses dragon then rock wins. (Rock smashes dragon.)

    2. If one player chooses plastic and other player chooses dragon then dragon wins. (Dragon burns plastic)

    3. If one player chooses rock and other player chooses plastic then plastic wins. (Plastic wraps rock)

    4. If both players make the same choice the game must be played again to determine the winner.

  6. The function should be named as RPDLastName (your lastname in place of lastname).

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!