Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

PROGRAM SPECIFICATION Rock, Paper, Scissors, Lizard, Spock Game The game is an expansion on the game Rock, Paper, Scissors. Each player picks a variable and

image text in transcribed
image text in transcribed
image text in transcribed
PROGRAM SPECIFICATION Rock, Paper, Scissors, Lizard, Spock Game The game is an expansion on the game Rock, Paper, Scissors. Each player picks a variable and reveals it at the same time. The winner is the one who defeats the others. In a tie, the process is repeated until a winner is found. Write a program that lets the user play the game of Rock, Paper, Scissors, Lizard, Spock against the computer. The program should work as follows. 1. When the program begins, a random number in the range of 1 through 5 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. If the number is 4, then the computer has chosen lizard. If the number is 5, then the computer has chosen Spock. (Don't display the computer's choice yet.) 2. The user enters his or her choice of "rock", "paper", "scissors", "lizard", or "Spock" at the keyboard. (Please use a menu) 3. The computer's choice is displayed 4. A winner is selected according to the following rules: . If one player chooses rock and the other player chooses scissors, then rock wins. (The rock smashes the scissors.) If one player chooses scissors and the other player chooses paper, then scissors wins. (Scissors cuts paper.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions