Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This week's Lab is: Rock, Paper, Scissors! Write a program which let's the user play rock, paper, scissors against the computer. It should: Ask for

This week's Lab is:
Rock, Paper, Scissors! Write a program which let's the user play rock, paper, scissors against the computer. It should:
Ask for the users name, utilize in output for scoring and messages
Randomly generate the computer's choice ("rock", "paper" or "scissors")
Ask the user to enter their choice ("rock", "paper" or "scissors")
Display the computer's choice
Compare the choices, then determine a winner:
rock beats scissors
paper beats rock
scissors beat paper
a tie results in a do-over until a winner is declared
The winner (user or computer) gets a point
After each round, display the total score for the user and the computer
Ask if the user wants to play again
If yes, then display another round
If no, then display the total number of rounds played and the final score
Helpful hint: use numbers to represent the computer's choices. For example: 1=rock, 2=scissors, 3=paper. This can make it easier to randomly generate the computer's choice.

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_2

Step: 3

blur-text-image_3

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

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions

Question

Contrast parental and peer influences during adolescence.

Answered: 1 week ago

Question

3. List ways to manage relationship dynamics

Answered: 1 week ago