Question

ITEMS SUMMARY 16, < Previous Nex The following program obtains three integers, x, y, and z, as input form the user. Complete

In the word game Boggle, a word is scored according to how many letters it contains: number of letters points scored 3 1 4 1

Write a program that simulates a round of the game Rock, Paper, Scissors. The program will take as input two strings, one for
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1->Program for finding zero sum subset

x=int(input());
y=int(input());
z=int(input());
if x+y==0:
print("zero sum found")
elif y+z==0:
print("zero sum found")
elif x+y+z==0:
print("zero sum found")
else:
print("no Zero sum found")

2-> Program for word game Boggle

word=input()
i = 0
while i < len(word): # Removing whitespaces
if word[i] == " ":
word = word[:i] + word[i+1:]
else:
i += 1
  
if len(word)==3:
print("1")
elif len(word)==4:
print("1")
elif len(word)==5:
print("2")
elif len(word)==6:
print("3")
elif len(word)==7:
print("5")
elif len(word)>=8:
print("11")

3->Program that simulates a round of game rock,paper,scissors

player1=input()
player2=input()

if player1=="rock" and player2=="scissors":
print("Player 1 wins")
elif player1=="scissors" and player2=="rock":
print("Player 2 wins")
elif player1=="scissors" and player2=="paper":
print("Player 1 wins")
elif player1=="paper" and player2=="scissors":
print("Player 2 wins")
elif player1=="paper" and player2=="rock":
print("Player 1 wins")
elif player1=="rock" and player2=="paper":
print("Player 2 wins")
else:
print("it is a tie")

Add a comment
Know the answer?
Add Answer to:
ITEMS SUMMARY 16, < Previous Nex The following program obtains three integers, x, y, and z,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a Python program (rock_paper_scissors.py) that allows two players play the game rock paper scissors. Remember...

    Write a Python program (rock_paper_scissors.py) that allows two players play the game rock paper scissors. Remember the rules: 1. Rock beats scissors 2. Scissors beats paper 3. Paper beats rock The program should ask the users for their names, then ask them for their picks (rock, paper or scissors). After that, the program should print the winner's name. Note, the players may pick the same thing, in this case the program should say it's tie. when the user input an...

  • Java CSC252   Programming II    Static Methods, Enums, Constants, Random Rock Paper Scissors Write a program that...

    Java CSC252   Programming II    Static Methods, Enums, Constants, Random Rock Paper Scissors Write a program that allows the user to play "Rock, Paper, Scissors". Write the RPS class. All code should be in one file. main() will be part of the RPS class, fairly small, and contain only a loop that asks the user if they want to play "Rock, Paper, Scissors". If they say yes, it calls the static method play() of the RPS class. If not, the program...

  • Rock, Paper, Scissors (also known by several other names, see http://en.wikipedia.org/wiki/Rock p...

    Help needed in Perl language program! Note : Perl Language Rock, Paper, Scissors (also known by several other names, see http://en.wikipedia.org/wiki/Rock paper scissors) is an extremely popular hand game most often played by children. Often, it is used as a method of selection similar to flipping a coin or throwing dice to randomly select a person for some purpose. Of course, this game is not truly random since a skilled player can often recognize and exploit the non-random behavior of...

  • Please help I am struggling with this and 3*Math.random())+1; and how to use it within the...

    Please help I am struggling with this and 3*Math.random())+1; and how to use it within the program For this project you will write a Java program that will play a simple game of Rock, Paper, Scissors.  If you have never played this game before the rules are simple - each player chooses one of Rock, Paper or Scissors and they reveal their choices simultaneously. • The choice of Rock beats the choice of Scissors ("Rock smashes Scissors") • The choice of...

  • Use Dev C++ for program and include all of the following. Im lost. Make sure the...

    Use Dev C++ for program and include all of the following. Im lost. Make sure the user enters a letter of R, P, or S and the computer generates a number between 0-2 and changes that number to a letter of R, P or S, using a switch. Make sure the user knows why he/she has won or lost – print a message like “Paper covers Rock” or “Scissors cuts Paper”. Ask the user how many times he/she wants to...

  • In python: The randrange(min, max) produces a random integer greater than or equal to min and...

    In python: The randrange(min, max) produces a random integer greater than or equal to min and less than max. So randrange(0,3) produces either 0, 1, or 2 Write a program that asks the user to input paper, rock, scissors, or done If they input something else, repeat  the question. If they input 'done', exit the game loop. If they input rock, paper, or scissors, have the computer pick a random choice. Write a function that takes two strings, each 'rock', 'paper',...

  • For this week’s assignment, we will be recreating the Rock, Paper, Scissors program using Object-...

    For this week’s assignment, we will be recreating the Rock, Paper, Scissors program using Object-Oriented Programming. You will be working with me on a team to build the program. I have already written my part of the program, and the Game.java file is attached. Your task will be to write a RockPaperScissors class that contains the following methods: getUserChoice: Has the user choose Rock, Paper, or Scissors. After validating the input, the method returns a String containing the user choice....

  • IN JAVA. Write a program that lets the user play the game of Rock, Paper, Scissors...

    IN JAVA. Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. 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....

  • (Java) Write a program that lets the user play the game of Rock, Paper, Scissors against...

    (Java) Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. 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. The...

  • This program should be in c++. Rock Paper Scissors: This game is played by children and...

    This program should be in c++. Rock Paper Scissors: This game is played by children and adults and is popular all over the world. Apart from being a game played to pass time, the game is usually played in situations where something has to be chosen. It is similar in that way to other games like flipping the coin, throwing dice or drawing straws. There is no room for cheating or for knowing what the other person is going to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT