Question: Implement a C++ console application that simulates a Rock-Paper-Scissor game against the computer. When played between two people, each person picks one of three options

Implement a C++ console application that simulates a Rock-Paper-Scissor game against the computer. When played between two people, each person picks one of three options (usually shown by hand gesture) at the same time, and a winner is determined. In the game, Rock beats Scissors, Scissors beats Paper, and Paper beats Rock. The program should randomly choose one of the three options (without revealing it), then ask for user input (choice of Rock, Paper or Scissor), and finally compare with users choice. At that point, the program reveals both choices and prints a statement indicating if the user won, the computer won, or it was a tie. Application should keep track of the current score (i.e. the number of user wins, losses, and ties) and update the screen after every play. User should be prompted after every game if they want to continue playing. At the beginning of the game the program should also ask the user for their name and display this name when showing the score. You do not need to use any user-defined functions for this assignment but you can add whatever you like so long as the criteria at the end of this document has been met. No bonus marks will be given, however. In addition to the requirements above, as part of this assignment you are to implement storing of game data into a text file. Game should always ask for a username (it has to be at least 8 characters) and store game results in a file with the same name as the username (username.txt). If the user has played the game before, the data should be read from the file and displayed on screen before starting a new game. At the end of the game the statistics should be saved on the same file. Game should not allow for same usernames unless it is the same user. This means that the game should check for existing usernames and prompt the new user for further authentication if needed. This would also guarantee that every user will have a unique game data statistics stored and not overridden by another user with the same username.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!