Question: language is C up CS 100 Lab Five Spring 2018 s g Name this program rps.c This program simulates two people playing the game rock-paper-scissors

language is C
up CS 100 Lab Five Spring 2018 s g Name this program rps.c This program simulates two people playing the game "rock-paper-scissors" and prints the results after playing a number of games. The program prompts the user for a number of games to play. It then "plays" that many games by generating two random numbers - one for each player- and determining the winner of that game. The program uses the following numbers: 0-rock, 1-paper, and 2 scissors. The main program, shown below, counts the number of times each player won and then prints the results. For example, playing 10 games on the cs-intro server woul generate the output There were 3 ties, 5 player one wins, 2 player two wins int main (void) f srand (0) Scissors beas paper int ties=0, plwins-o, p2wins=0 ; games getNumGames () for (int a-0 acgames: att) t plmove = rand ( ) 3; ans findWinner (plmove, p2move) if (ans 0) ties++; if (ans 2, p2wins++; printResults (ties, plwins, p2wins) return 0: rgain. You the ncions shown below threeft Prompt the user for the number of games to play, read that number, return it The two arguments passed to the function are player l's move (0-2) and player 2's move (0-2) must write int get NumGames (void) I/ determines the number of games to play .int findWinner (int, int) II determines a single game winner o Return a 0 for a tie, 1 if player 1 won that game, and a 2 if player 2 won that game o . void printResults (int, int, int) prints the final results ne three arguments passed are the number of ties, player 1 wins, and player2wins o o Prints these three results in the order of ties/player 1 wins/ player 2 wins 2. Name this prograim missing.c -This pio ck, oaly we are now wsing funcions Reell hat the program reads strings from standard input until end-of-file, and then prints out the letters that were not seen in the i For this version, you must handle both upper- and lower-case letters, as well as ignoring anything that is not a letter nput void inerementCounts( char . int [ i void printMissing(int ) int main (void) int counts (2610 printf ("Enter some text, ending with
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
