Submit a single source code file (game.c) to Gradescope. You are working at GenXYZ where you develop
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Due: Tuesday, January 30, 11:59pm Submit a single source code file (game.c) to Gradescope. You are working at GenXYZ where you develop educational software to engage young students. Your task is to write a simple rock, paper, scissors game in C. The game should allow a player to play against the computer by entering their choice of rock, paper or scissors. The winner is determined according to the rules of the classic game: After the game they are asked if they want to play again. They can quit the game by pressing "q Here is an example of how the game plays: Welcome to Rock, Paper, Scissors! Press "q' to quit or any other key to continue: Enter your move (r for rock, p for paper, s for scissors): Computer's move: s You win! Press 'q' to quit or any other key to continue: x Enter your move (r for rock, p for paper, s for scissors): p Computer's move: You wint Press 'q' to quit or any other key to continue: Enter your move (r for rock, p for paper, s for scissors): 234234 Invalid move. Enter your move (r for rock, p for paper, s for scissors): asdfsf Invalid move. Enter your move (r for rock, p for paper, s for scissors): r Computer's move: p Scissors Computer wins! Press 'q' to quit or any other key to continue: 9 Bye Bye! Consider structuring your program as four functions: GetPlayerHove() check for valid input and re-prompt if invalid return 'r', 'p', or 's'. Get ComputerMove() use rand() return 'r', 'p', or 's' PlayRockPaperScissorsGane() get noves use rules to check for winnner print("You win!") main() while c != 'q' PlayRockPaperScissorsGame() print("Bye Bye !") Your assignment will be graded on how well it plays (70pts.) and how well your code is written and its readability (30pts.). Be consistent in your formatting and use of Cidioms. Due: Tuesday, January 30, 11:59pm Submit a single source code file (game.c) to Gradescope. You are working at GenXYZ where you develop educational software to engage young students. Your task is to write a simple rock, paper, scissors game in C. The game should allow a player to play against the computer by entering their choice of rock, paper or scissors. The winner is determined according to the rules of the classic game: After the game they are asked if they want to play again. They can quit the game by pressing "q Here is an example of how the game plays: Welcome to Rock, Paper, Scissors! Press "q' to quit or any other key to continue: Enter your move (r for rock, p for paper, s for scissors): Computer's move: s You win! Press 'q' to quit or any other key to continue: x Enter your move (r for rock, p for paper, s for scissors): p Computer's move: You wint Press 'q' to quit or any other key to continue: Enter your move (r for rock, p for paper, s for scissors): 234234 Invalid move. Enter your move (r for rock, p for paper, s for scissors): asdfsf Invalid move. Enter your move (r for rock, p for paper, s for scissors): r Computer's move: p Scissors Computer wins! Press 'q' to quit or any other key to continue: 9 Bye Bye! Consider structuring your program as four functions: GetPlayerHove() check for valid input and re-prompt if invalid return 'r', 'p', or 's'. Get ComputerMove() use rand() return 'r', 'p', or 's' PlayRockPaperScissorsGane() get noves use rules to check for winnner print("You win!") main() while c != 'q' PlayRockPaperScissorsGame() print("Bye Bye !") Your assignment will be graded on how well it plays (70pts.) and how well your code is written and its readability (30pts.). Be consistent in your formatting and use of Cidioms.
Expert Answer:
Related Book For
Fundamentals of Cost Accounting
ISBN: 978-0077398194
3rd Edition
Authors: William Lanen, Shannon Anderson, Michael Maher
Posted Date:
Students also viewed these algorithms questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
On March 20, Harbor's petty cash fund of $100 is replenished when the fund contains $19 in cash and receipts for postage $40, supplies $26, and travel expense $15. Prepare the journal entry to record...
-
Find the inverse of the matrix, if possible. 1. 2. 3. [5 3 27 3
-
A spaceship of proper length L = 400 m moves past a transmitting station at a speed of 0.76c. At the instant that the nose of the ship passes the transmitter, clocks at the transmitter and in the...
-
The long straight wire in Figure P29.17 carries a current \(I\) that varies in time as \(I=I_{0} \sin (\omega t)\), and a loop of wire is held stationary near the straight wire. When is the induced...
-
Several independent audit situations are presented here. Assume that everything other than what is described would have resulted in an unqualified opinion. Required Indicate the type of opinion you...
-
Which OSI layer is responsible for connection - oriented communication?
-
028. A student holding two weights close to his chest is sitting on a frictionless chair; the student and chair are rotating with an angular speed of 10 rad/s. The rotational inertia of Student +...
-
Locate a newspaper, magazine, or internet article on a public good or service. What is the public good or service discussed in this article? Is this a "pure" public good or service, or is it...
-
package p1; class Test8{ package p2; import p1.Test8; int i; Take a look at the class declaration below: package p3; import p1.Test8; import p2.Test9; private int j; class Test9 extends Test8 {...
-
The department hosted a barbecue to raise money for charity. Each hot dog cost $2.00 and each hamburger cost $4.00. They raised $3,000 at the barbecue. The same number of hot dogs and hamburgers were...
-
Assume sales of $11600, variable costs of $7700, and fixed costs of $2700. Calculate contribution margin and operating income.
-
Write and run the following program. public class TempConverter { public static void main(String[] args) { double fahrenheit = 100; double celsius; celsius = 0.56 * (fahrenheit - 32);...
-
Jane files as a single taxpayer for 2020. She has wage income of $100,000; net long-term capital gains of $30,000; net short-term capital gains of $10,000; corporate bond interest of $5,000; share of...
-
Identify the tax issues or problems suggested by the following situations. State each issue as a question. Jennifer did not file a tax return for 2007 because she honestly believed that no tax was...
-
What are the costs of a product using normal costing?
-
The more important individual unit costs are used for decisions, the more likely it is that process costing will be preferred to job costing. Do you agree?
-
You were appointed the manager of Drive Systems Division (DSD) at Tunes2Go, a manufacturer of portable music devices using the latest developments in hard drive technology, on December 15 last year....
-
Let \(\left(B_{t} ight)_{t \geqslant 0}\) be a \(\mathrm{BM}^{1}\) and \(b(x), \sigma(x)\) autonomous and globally Lipschitz continuous coefficients. We have seen in Corollary 21.24 that the solution...
-
The linear growth of the coefficients is essential for Corollary 21.31. a) Consider the case where \(d=n=1, b(x)=-e^{x}\) and \(\sigma(x)=0\). Find the solution of this deterministic ODE and compare...
-
Let \((A, \mathfrak{D}(A))\) be the generator of a diffusion process in the sense of Definition 23.1 and denote by \(a, b\) the diffusion and drift coefficients. Show that \(a \in...
Study smarter with the SolutionInn App