Question: Task 4 Game programming Rock, Paper, ScissorsDesign a program that lets the user play the game of Rock, Paper, Scissors against thecomputer. The rules of
Task Game programming Rock, Paper, ScissorsDesign a program that lets the user play the game of Rock, Paper, Scissors against thecomputer. The rules of the game are:If the user and the computer choose the same, the outcome is a draw.The program should work as follows: The user is asked to enter his or her choice of rock, paper, scissors or quit atthe keyboard. Any other input should be flagged as an error and the user promptedto enter another choice If the user has not entered quit the computer uses the random function to selecteither rock, paper, or scissors; else the programs ends The program should then display the computers choice, the users choice, and theoutcome of the game, according to the above rules Repeat at For example, if the user enters rock and the computer chooses paper, the output of theprogram should be:Computer chose: Paper User chose: RockComputer wins: Paper beats RockWhen designing your solution, you will need to think carefully about what type of problemsolving strategy you will need to deploy to design the logic for your program; for example,can visualization be used decision tables, logical rules, etc. or can it be solved usingmathematical reasoning; this will influence how you decide to model the data? You shoulduse arrays to store the possible choices and loops to control data input validation and tofacilitate the user quitting or having another go and of course selection control structuresto model the game logic.Make a flowgorithm
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
