Write an ada program that plays the game rock paper


Problem

Write an Ada program that plays the game "rock, paper, scissors." In this game, two players choose simultaneously either rock, paper, or scissors. Whether a player wins or loses depends not only on that player's choice but also on the opponent's. The rules are:

- Rock breaks scissors: rock wins.

- Paper covers rock: paper wins.

- Scissors cuts paper: scissors wins.

- All matching combinations are ties.

Each player uses the editor to prepare a text file containing his or her choices for a number of games. Choices are Rock, Paper, and Scissors. (In your program, use an enumeration type for these choices.) Each choice for a game is on a separate line. It may have blanks before and after it. Your program should read the choices from the two files and determine and display those choices and the winner of each game. After all games have been played, display the total number of games played, the number of games won by each player, and the number of tie games. Because the players have not agreed in advance on the number of games to play, your program should terminate when all of the choices in one file have been played. If a particular choice for a game is not spelled correctly, that player forfeits the game. If both players have invalid choices, it is considered a tie game. An appropriate message should be displayed if one or both players' choice is invalid. The invalid choice should not be displayed.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write an ada program that plays the game rock paper
Reference No:- TGS02652637

Expected delivery within 24 Hours