Computers and Technology

Write a program that lets the user play the game of rock, paper, scissors against the computer. the program should work as follows. 1. when the program begins, a random number in the range of 1 through 3 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. (don’t display the computer’s choice yet.) 2. the user enters his or her choice of “rock”, “paper”, or “scissors” at the keyboard. (you can use a menu if you prefer.) 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 breaks the scissors.) • if one player chooses scissors and the other player chooses paper, then scissors wins. (scissors cuts paper.) • if one player chooses paper and the other player chooses rock, then paper wins. (paper wraps rock.) • if both players make the same choice, the game must be played again to determine the winner. be sure to divide the program into functions that perform each major task. include the code and the console output from running your program with test inputs in your report.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:00, brockmorrison3468
Is it ok to use a does red wine clean the inside of a computer true or false
Answers: 2
image
Computers and Technology, 22.06.2019 10:30, robert7248
You have a large, late-model pick-up truck with a rear seat. the pick-up truck weighs 6,500 pounds. the florida seat belt law
Answers: 1
image
Computers and Technology, 22.06.2019 16:30, nxusasmangaliso1191
The most common battery cable terminal is a that provides a large surface contact area with the ability to tighten the terminal onto the battery post using a nut and bolt.
Answers: 2
image
Computers and Technology, 22.06.2019 20:00, jayjay5246
What is the term for water wave that is created by an underwater earthquake
Answers: 1
Do you know the correct answer?
Write a program that lets the user play the game of rock, paper, scissors against the computer. the...

Questions in other subjects: