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.
Mixed soup
Alphabet soup
Number soup
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: # where #
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 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 isvalidoption
Checks if the menu entry is the correct range and type int
void scorestatus
Prints the updated score for each player.
A function with logic for each mathematical operation
void mixedsoup
void alphabetsoup
void numbersoup
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 characters.
Initialize the random seed with srandtimeNULL The seed is initialized only once,
ie 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 chars excluding the NULL terminator ie
Each char in a soup is different from each other.
Example of an invalid Number soup:
A soup with all consecutive char values is considered invalid: eg
Mixed soup chars are ASCII values in
Alphabet soup chars include azAZ
Number soup chars include
The soup code in a Number soup concatenates the ASCII digits of each char.
Example: Code:
The soup code in a Mixed or Alphabet soup concatenates the ASCII digits of each char.
Eg the code for is not
Note: 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
