Question: Create a program in C . The game displays a welcome message and asks for the player's name, as follows: Player's name: After, a menu

Create a program in C. The game displays a welcome message and asks for the player's name, as follows:
Player's name:
After, a menu with these options is displayed asking to enter an option.
1. Mixed soup
2. Alphabet soup
3. Number soup
4. Quit
Select an option:
If the option is invalid (a number out of range or a different data type), then an Error message is
displayed, and the player is prompted again to enter a valid option.
Once a valid option is selected, the program shows:
A message of the selected soup type.
The updated score status for each player in the form:
, match points: round points:
Computer, match points: round points:
The message [Play], which runs the next round.
The current round in the form Round: #/10, where # =[1-10].
The soup (random string enclosed in "") and its code
Each player's soup, soup code, match for the round soup, and a graphical match sequence
[with X or to indicate a match or mismatch respectively].
The updated score status.
The message [Continue].
After completing all 10 consecutive rounds and select [Continue] is displayed, the following
is shown:
Game Over
The score for each player indicating match points and round points.
If there is a winner: won this game.
If both earned the same score: The game ended in a tie.
[Return to menu].
Required Functions:
The program must contain at least the following functions:
int menu(...)
Displays the menu with all options and retrieves user input.
int is_valid_option(...)
Checks if the menu entry is the correct range and type (int).
void score_status(...)
Prints the updated score for each player.
A function with logic for each mathematical operation
void mixed_soup (...)
void alphabet_soup (...)
void number_soup(...)
Choose the appropriate parameters (...) for each of the following functions.
You can create additional functions that help you better organize the game logic.
Guidelines:
Global variables are not allowed.
Include comments in your code explaining the main logic of each important part.
The player's name can only contain letters and blank spaces and is at most 25 characters.
Initialize the random seed with srand(time(NULL)). The seed is initialized only once,
i.e., you must not call this function again during your program run.
Assume that the user input to select an option in the menu is an integer.
Soups:
A soup always has 10 chars (excluding the NULL terminator i.e.'\0').
Each char in a soup is different from each other.
Example of an invalid Number soup: "0132451125"
A soup with all consecutive char values is considered invalid: e.g."0123456789"
Mixed soup chars are ASCII values in [33-126].
Alphabet soup chars include ['a'-'z','A'-'Z'].
Number soup chars include ['0'-'9'].
The soup code in a Number soup concatenates the ASCII (2 digits) of each char.
Example: "3951206784" Code: 51575349504854555652
The soup code in a Mixed or Alphabet soup concatenates the ASCII (3 digits) of each char.
E.g., the code for '%' is 037, not 37.
Note: 037 is NOT an octal, it is just the code to represent that character in the soup.

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!