Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have to use it with an array Rock Paper Scissors Input File: rock-paper-scissors-sample file.txt Rock, paper, scissors is a classic childrens game. The rules

image text in transcribed

I have to use it with an array

Rock Paper Scissors Input File: rock-paper-scissors-sample file.txt Rock, paper, scissors is a classic childrens game. The rules are simple. At the same time, each person makes a hand representation of a rock, a sheet of paper, or a pair of scissors. Each symbol chosen has a cyclical status of dominance over the over, ie., rock bets scissors, scissors cuts papers, and paper covers rock. If the two players chose the same symbol, it results in a draw. Write a program that reads a file with the users input of an "R" for "Rock", a "P" for "Paper", and a "S" for "Scissors". You must then determine the winner based upon the rules above. Also, at the end of the series of game, you must present a summary of each user's wins and the number of draws. Sample input: Sample output: Player 1 Player 2 Rock Result: Winner Player 1 Player 1 Player 2 Rock Scissors Summary: Total Number of Games played: X>X Player 1 won XX games. Player 2 won XX games. Draws: XX Rock Result: Draw Rock Paper Scissors Input File: rock-paper-scissors-sample file.txt Rock, paper, scissors is a classic childrens game. The rules are simple. At the same time, each person makes a hand representation of a rock, a sheet of paper, or a pair of scissors. Each symbol chosen has a cyclical status of dominance over the over, ie., rock bets scissors, scissors cuts papers, and paper covers rock. If the two players chose the same symbol, it results in a draw. Write a program that reads a file with the users input of an "R" for "Rock", a "P" for "Paper", and a "S" for "Scissors". You must then determine the winner based upon the rules above. Also, at the end of the series of game, you must present a summary of each user's wins and the number of draws. Sample input: Sample output: Player 1 Player 2 Rock Result: Winner Player 1 Player 1 Player 2 Rock Scissors Summary: Total Number of Games played: X>X Player 1 won XX games. Player 2 won XX games. Draws: XX Rock Result: Draw

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

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions