Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

Why did Rita finally decide to seek treatment?

Answered: 1 week ago