Starting out with Visual C# (4th Edition)
Starting out with Visual C# (4th Edition)
4th Edition
ISBN: 9780134382609
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 6, Problem 10PP

Rock, Paper, Scissors Game

Create an application 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 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. (Do not display the computer’s choice yet.)
  2. 2. The user selects his or her choice of rock, paper, or scissors. To get this input you can use Button controls, or clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.
  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. (Rock smashes 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 modularize the program into methods that perform each major task.

Blurred answer
07:40
Students have asked these similar questions
Rock, Paper, Scissors Game Create a application using (C#) in Microsoft Visual Studio 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. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you use clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.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. (Rock smashes scissors.)•If one player chooses scissors and the other player chooses paper, then scissors wins.…
Random Number Guessing Game Create an application that generates a random number in the range of 1 through 100 and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high, try again.” If the user’s guess is lower than the random number, the program should display “Too low, try again.” If the user guesses the number, the application should congratulate the user and then generate a new random number so the game can start over. Optional Enhancement: Enhance the game so it keeps count of the number of guesses that the user makes. When the user correctly guesses the random number, the program should display the number of guesses.
9. Trivia Game In this programming exercise, you will create a simple trivia game for two players. The program will work like this:     Starting with player 1, each player gets a turn at answering 5 trivia questions. (There should be a total of 10 questions.) When a question is displayed, 4 possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point.     After answers have been selected for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner. To create this program, write a Question class to hold the data for a trivia question. The Question class should have attributes for the following data:     A trivia question     Possible answer 1     Possible answer 2     Possible answer 3     Possible answer 4 The number of the correct answer (1, 2, 3, or 4) The Question class also should have an appropriate _…

Chapter 6 Solutions

Starting out with Visual C# (4th Edition)

Ch. 6.4 - Prob. 6.11CPCh. 6.4 - Prob. 6.12CPCh. 6.4 - Prob. 6.13CPCh. 6.4 - Prob. 6.14CPCh. 6.5 - What is a value-returning method? How is it used?Ch. 6.5 - Prob. 6.16CPCh. 6.5 - Can a method be written to return any type of...Ch. 6 - In general terms, a program that is broken into...Ch. 6 - Prob. 2MCCh. 6 - When you call a(n) __________, it simply executes...Ch. 6 - Prob. 4MCCh. 6 - Prob. 5MCCh. 6 - The __________ is the memory address that is saved...Ch. 6 - Programmers commonly use a technique known as...Ch. 6 - Prob. 8MCCh. 6 - Prob. 9MCCh. 6 - A __________ specifies which parameter an argument...Ch. 6 - When a(n)__________ is provided for a parameter,...Ch. 6 - When an argument is __________, only a copy of the...Ch. 6 - Prob. 13MCCh. 6 - Prob. 14MCCh. 6 - Prob. 15MCCh. 6 - Prob. 16MCCh. 6 - Dividing a large problem into several smaller...Ch. 6 - In a Pascal case name, the first character is...Ch. 6 - Prob. 3TFCh. 6 - The contents of variables and the values of...Ch. 6 - You do not have to write the data type for each...Ch. 6 - An output parameter works like a by value...Ch. 6 - Prob. 7TFCh. 6 - A Boolean method returns either yes or no.Ch. 6 - Prob. 1SACh. 6 - Prob. 2SACh. 6 - What is another name for the top-down design...Ch. 6 - Prob. 4SACh. 6 - How do you specify a named argument?Ch. 6 - Prob. 6SACh. 6 - How is a value-returning method like a void...Ch. 6 - Can Boolean methods be used to modularize input...Ch. 6 - Examine the following method header; then write an...Ch. 6 - The following statement calls a method named...Ch. 6 - Write the method header for a method named...Ch. 6 - Examine the following method header; then write an...Ch. 6 - A program contains the following value-returning...Ch. 6 - Retail Price Calculator Create an application that...Ch. 6 - Falling Distance When an object is falling because...Ch. 6 - Kinetic Energy In physics, an object that is in...Ch. 6 - Calories from Fat and Carbohydrates A nutritionist...Ch. 6 - Joes Automotive Joes Automotive performs the...Ch. 6 - Hospital Charges Create an application that...Ch. 6 - Present Value Suppose you want to deposit a...Ch. 6 - Prime Numbers A prime number is a number that can...Ch. 6 - Prime Number List This exercise assumes you have...Ch. 6 - Rock, Paper, Scissors Game Create an application...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
File Head Display Write a program that asks the user for the name of a file. The program should display only th...

Starting Out with Java: From Control Structures through Data Structures (3rd Edition)

What is the output of the following code? public class Test { public static void main(String[] args) { java.mat...

Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)

The ____________ is always transparent.

Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)

Knowledge Booster
Background pattern image
Computer Science
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
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
CPP Function Parameters | Returning Values from Functions | C++ Video Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=WqukJuBnLQU;License: Standard YouTube License, CC-BY