Question
Sample Output: Get ready, John! Its now time to Wordle with Tom! You will have a total of 6 attempts to guess the word correctly.
Sample Output:
Get ready, John! Its now time to Wordle with Tom!
You will have a total of 6 attempts to guess the word correctly.
This is your attempt #1, John, please enter a valid five-letter word (all UPPERCASE): CAT
Seriously? Your input word is 3 letters long! Dont make me quit on you right now
Please enter your guessing word again (remember, it has to be a valid five-letter word all UPPERCASE): 2CATS
Dont make me arrest you! Your input word is contaminated with non-alphabet characters
Please enter your guessing word again (remember, it has to be a valid five-letter word all UPPERCASE): KITTY
You entered KITTY. Nice try, keep going!
K: @ . @
I: @ . @
T: @ . @
T: @ . @
Y: @ . @
This is your attempt #2, John, please enter a valid five-letter word (all UPPERCASE): CLOTH
You entered CLOTH. Nice try, keep going!
C: @.@
L: @.@
O: ^-^
T: @.@
H: @.@
This is your attempt #3, John, please enter a valid five-letter word (all UPPERCASE): PONDS
You entered PONDS. Nice try, keep going!
P: @.@
O: ^o^
N: ^-^
D: ^-^
S: ^-^
This is your attempt #4, John, please enter a valid five-letter word (all UPPERCASE): SOUND
You entered SOUND. Congratulations, SOUND it is!
Functional requirement 2: The validateWord(word) function
This function should have one parameter being the word entered by the players. It takes the input word and checks whether it is a valid 5-letter word with only alphabetical characters. If the word is not valid, it should prompt the user to enter the word again until a valid word is entered. At the end, this function should return the validated word back to the caller.
Functional requirement 3: The displayFeedback(key, guess) function
This function takes the key word and the current guess word as parameters and outputs the corresponding feedback for the guess, as described in the assignment description. It should not return anything.
Functional requirement 4: The printGameSummary(player1, player2, oldLevel, newLevel) function
The purpose of this function is to output the game summary at the end of each round. This function should have four parameters: one for the name of Player 1, one for the name of Player 2, one for the original friendship level before the round begins, and one for the current friendship level at the end of the round. A sample output from this function is provided below. Again, it does not have a return type.
End-of-Round Game Summary
Player 1: Frank
Player 2: Fiona
Initial friendship level: 10
Current friendship level: 13
This is C++ code and the question is how to implement Functional requirement 3 to do correct notation of evaluating each letter in the key word and guess (both found using functional requirement 2 to make sure they are appropriate length and only alphabetical). Now we need to check each character in the string for key word and see if it matches the one in guess in the allowed amount of guess attempts (6). At the top is the sample output of what it is meant to look like. Any help would be appreciated. Thanks!
Player 2 will have a maximum of six attempts to guess the word correctly. In each attempt, the program should prompt Player 2 to enter their word, and then see if the entered word matches with the key. If it's an exact match, then the program should output a congratulations message. However, if it's not a perfect match, then the program should provide some useful feedback as in the original game using the following notations: - Notation @.@ should he used if an input letter is not a part of the key - Notation should be used if an input letter is a part of the key but is not in the right position at the right position For example, if the key word is "beard" and Player 2 entered "bound" as the first attempt, then the feedback provided should be: You entered "BOUND". Nice try, keep going! B:n0 UT= @ 6 N=a. C D=n0 The completion of all six attempts concludes a round. If Player 2 guessed the key word correctly, then the friendship level value should be correspondingly increased by the number of attempts Player 2 took to get to the correct word. Note that the maximum value friendship level can reach is 100 . Next, the program should ask Player 1 if they want to begin a new round. If no, then the program will then keep asking Player 1 if they want to start a new round with a different Player 2 . If Player 1 inputs no, then theStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started