bartleby

Concept explainers

bartleby

Videos

Textbook Question
100%
Book Icon
Chapter 14, Problem 12PC

Rock, Paper, Scissors Game

Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows:

  1. 1. When the program begins, a random number in the range of 0 through 2 is generated. If the number is 0, then the computer has chosen rock. If the number is 1, then the computer has chosen paper. If the number is 2, then the computer has chosen scissors. (Don’t display the computer’s choice yet.)
  2. 2. To make his or her selection, the user clicks an image on the screen. (You can find images for this game included in the book’s online resources at www.pearsonhighered. com/gaddis.)
  3. 3. The computer’s choice is displayed.
  4. 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.)
    • 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 is a tie.
Blurred answer
Students have asked these similar questions
using r language to answer question 4. Question 4: Obtain a 95% standard normal bootstrap confidence interval, a 95% basic bootstrap confidence interval, and a percentile confidence interval for the ρb12 in Question 3.
using r language
using r language

Chapter 14 Solutions

Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)

Ch. 14.1 - Prob. 14.11CP Ch. 14.1 - Which of the following is not a subclass of the... Ch. 14.2 - Prob. 14.13CP Ch. 14.2 - Prob. 14.14CP Ch. 14.2 - Prob. 14.15CP Ch. 14.2 - Prob. 14.16CP Ch. 14.2 - Prob. 14.17CP Ch. 14.2 - Prob. 14.18CP Ch. 14.2 - Prob. 14.19CP Ch. 14.2 - Prob. 14.20CP Ch. 14.2 - Prob. 14.21CP Ch. 14.3 - Prob. 14.22CP Ch. 14.3 - Prob. 14.23CP Ch. 14.3 - Prob. 14.24CP Ch. 14.3 - Prob. 14.25CP Ch. 14.3 - Prob. 14.26CP Ch. 14.3 - Prob. 14.27CP Ch. 14.3 - Prob. 14.28CP Ch. 14.3 - Prob. 14.29CP Ch. 14.3 - Prob. 14.30CP Ch. 14.4 - What two classes do you use to play an audio file? Ch. 14.4 - Refer to your answer to Checkpoint 14.31. In what... Ch. 14.4 - Prob. 14.33CP Ch. 14.4 - Prob. 14.34CP Ch. 14.5 - What three classes do you use to play a video... Ch. 14.5 - Refer to your answer to Checkpoint 14.35. In what... Ch. 14.5 - Prob. 14.37CP Ch. 14.6 - Prob. 14.38CP Ch. 14.6 - Prob. 14.39CP Ch. 14.6 - What type of event happens when the user presses... Ch. 14.6 - What KeyEvent method can you call to determine... Ch. 14.6 - Refer to your answer for Checkpoint 14.41. What... Ch. 14 - Line, Circle, and Rectangle are subclasses of... Ch. 14 - Prob. 2MC Ch. 14 - Prob. 3MC Ch. 14 - Prob. 4MC Ch. 14 - Prob. 5MC Ch. 14 - Prob. 6MC Ch. 14 - Prob. 7MC Ch. 14 - Prob. 8MC Ch. 14 - This interpolator causes an animation to start... Ch. 14 - You use these two classes to play an audio file.... Ch. 14 - Prob. 11TF Ch. 14 - Prob. 12TF Ch. 14 - True or False: If an ellipses X-radius and... Ch. 14 - Prob. 14TF Ch. 14 - Prob. 15TF Ch. 14 - Write a statement that instantiates the Line... Ch. 14 - Prob. 2AW Ch. 14 - Prob. 3AW Ch. 14 - Write code that does the following: Instantiates... Ch. 14 - Prob. 5AW Ch. 14 - Prob. 6AW Ch. 14 - Prob. 7AW Ch. 14 - Prob. 8AW Ch. 14 - Prob. 9AW Ch. 14 - Prob. 10AW Ch. 14 - Prob. 11AW Ch. 14 - Prob. 1SA Ch. 14 - Prob. 2SA Ch. 14 - Prob. 3SA Ch. 14 - Prob. 4SA Ch. 14 - Prob. 5SA Ch. 14 - Prob. 6SA Ch. 14 - What RotateTransition class method do you use to... Ch. 14 - Prob. 8SA Ch. 14 - Prob. 9SA Ch. 14 - Prob. 10SA Ch. 14 - Prob. 11SA Ch. 14 - This Old House Use the basic shapes you learned in... Ch. 14 - Tree Age Counting the growth rings of a tree is a... Ch. 14 - Hollywood Star Make your own star on the Hollywood... Ch. 14 - Prob. 4PC Ch. 14 - Solar System Use the Circle class to draw each of... Ch. 14 - Prob. 6PC Ch. 14 - Prob. 7PC Ch. 14 - Prob. 8PC Ch. 14 - Coin Toss Write a program that simulates the... Ch. 14 - Lunar Lander The books online resources... Ch. 14 - Change for a Dollar Game The books online... Ch. 14 - Rock, Paper, Scissors Game Write a program that...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
The startsWith, endsWith, and regionMatches methods are members of this class. a. String b. Char c. Character d...

Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)

A loop that evaluates its test expression after each repetition is a(n) _____ loop.

Starting Out with C++ from Control Structures to Objects (9th Edition)

Knowledge Booster
Background pattern image
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
    SEE MORE QUESTIONS
    Recommended textbooks for you
    Text book image
    C++ for Engineers and Scientists
    Computer Science
    ISBN:9781133187844
    Author:Bronson, Gary J.
    Publisher:Course Technology Ptr
    Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781305480537
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    Text book image
    C++ Programming: From Problem Analysis to Program...
    Computer Science
    ISBN:9781337102087
    Author:D. S. Malik
    Publisher:Cengage Learning
    Text book image
    Programming Logic & Design Comprehensive
    Computer Science
    ISBN:9781337669405
    Author:FARRELL
    Publisher:Cengage
    Text book image
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
    Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY; License: Standard YouTube License, CC-BY