Computers and Technology Quiz & Practice Tests - Test Your Skills

In C++ programming please.Rock, Paper, Scissors Game.a) Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows:1. When the program begins, a random number in the range of 1 through 3 is generated (1+rand()%3). 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, them the computer has chosen scissors. (Don't display computer's choice yet).2. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. (You can use a menu if you prefer).3. The computer's choice is displayed.4. A winner is selected according to the rock paper scossors game riles.Be sure to divide the program into the following functions: int getUserChoice ();The getUserChoice function displays a menu allowing the user to select rock, paper, or scissors. 4 to Quit the game The function then returns 1 for rock, or 2 for paper, or 3 for scissors. User input validation of the choicesint getComputerSchoice (); The getComputerChoice function returns the computer's game choice.It returns 1 for rock (via the ROCK constant), or 2 for paper (via the PAPER constant), or 3 for scissors determineWinner (int, int);The determineWinner function accepts the user's game choice and the computer's game choice as arguments and displays the choices, and a message indicating the winner. void displayChoice (int);The displayChoice function accepts an integer argument and displays rock, paper, or Scissors. int main () Loop while user choice is not 4 (Quit the game)
In this lab, you will design a die game called 15. The object of the game is to score exactly 15 points in as few rolls of the die as possible. After each roll, the player can choose to add the current die value to his or her score or not, unless the die value is six, in which case it is automatically added to the players score. If the players score exceeds 15, the player loses. If the players score is equal to 15, the player wins. Play continues until the player reaches or exceeds 15 points.Description:To start the game, the player presses the reset switch. The score will be set to zero and both the Win and Lose LEDs will be turned off. The player then rolls the die by toggling the Rb switch to the Roll position. The die counter should operate with a clock frequency of 27 MHz or 50 MHz so that the player cannot control the outcome of a roll. After about a second or more, the player toggles the Rb switch back to the Off position to end the roll. The Turn Counter should be incremented to indicate that the player has taken a roll. If the player rolled a six, it is automatically added to his or her score. Otherwise, the player can press the Add button to add the die value to his or her score or the player can press the Pass button to leave the score unchanged. After each roll, the score will be greater than, less than or equal to 15. If the score is equal to 15, the player wins the Win LED should be turned on and remain on until the system is reset for a new game. If the score is greater than 15, the player loses the Lose LED should be turned on and remain on until the system is reset. Once the player has won or lost, the player cannot roll the die again until the system is reset. (The Rb switch will not have any effect in these states.) If the score is less than 15, the player will roll again. After each roll, the player presses either the Add button or the Pass button (unless a six is rolled) before the die can be rolled again. Play continues until the players score equals or exceeds 15.1) Draw a state diagram for the game as a Moore finite state machine.2) Draw a state diagram for the game as a Mealy finite state machine.