Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write this in C++ You need to write a program to play Rock, Paper , Scissors. Start by h ave the p layer input his/her

Write this in C++
You need to write a program to play Rock, Paper, Scissors. Start by have the player input his/her choice R, S, or P. Hint, what data type should you use here? Answer char. Then have the computer generate its choice randomly as an integer (0-2 or 1-3). Remember to seed your random generator at the top of the main method, using srand(time(0)); which requires you to include and . This will make sure the game is truly random the user has no control on the output of the random number generator. Now that you have the numeric choice for the computer, you will need to convert (using a switchstatement) it into a letter (R, S, or P.) Then determine the winner of the game. Remember that Rock crushes Scissors, Paper covers Rock, and Scissors cuts Paper. You must print these explanations not just that the user won or the computer won.

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

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

List the four categories of HR metrics.

Answered: 1 week ago