Question: This is in the C++ programming language, I'll give a thumbs up, thank you in advance! it is really important 3. Assignment Description Your assignment
This is in the C++ programming language, I'll give a thumbs up, thank you in advance! it is really important











3. Assignment Description Your assignment is to develop the code to have the user play a game of word guess against the computer. The computer randomly chooses the word and the user guesses letter by letter until they run out of guesses or correctly figure out the word. The user can continue to play the game until they opt out. 4. Requirements: This is a list of the requirements of this application. For this project, it is up to you exactly how you want to implement it. For you to earn all the points, however, you will need to meet all the defined requirements. You must follow the coding standard as defined in the CMSC 202 coding standards (found on Blackboard under course materials). This includes comments as required. The project must be turned in on time by the deadline listed above. The project must be completed in C++. You may not use any libraries or data structures that we have not learned in class. Do not use pointers in this project. These are the only libraries that you are allowed to use in this project , , , , , and . You may use . You should only use namespace std. You must use a variety of functions (at least 5) including passing parameters to those functions and returning information from those functions. At least one time, an array of any size) must be passed to a function (although you may do this more than once). All user input must be validated. For example, if a menu allows for 1, 2, or 3 to be entered and the user enters a 4, it will re-prompt the user. However, the user is expected to always enter the correct data type. .e. If the user is asked to enter an integer, they will. If they are asked to enter a character, they will. You do not need | to worry about checking for correct data types. All puzzles will be lower case. If a user enters an upper case letter it prompts the user for a new letter. You may use multi-dimensional arrays, but you are NOT required to for this project. When the program is initially started, it should load the list of words into an array. The words will not have any spaces in them. The list of words can be of any length. You must keep track of letters guessed to see if the user has lost the game. If a user guesses the same letter twice, it should be counted as a missed" guess. For example, if the user guesses the letter 'a' seven times, they would automatically lose even if the letter was in the puzzle. The input file will always be named "words.txt" and can have any number of words in the file. The words should all be stored as strings (not c-strings). The program will randomly select a "correct word from the list of words loaded from the file. Once the correct word is chosen, it should display one underscore for each letter in the word. The program should indicate the results of the run and to re-prompt the user to play again. Exit and include a thank you message for the user. O Specific coding requirements include: Must use at least 5 different functions. Must be able to read the list of words in from a file. The file can be any size (not hardcoded length). Must store all words as strings using the library o May use multidimensional arrays but not required o Must pass at least one array to a function o Must not use any global variables (constants are good!) Must use input validation (assume the data is the correct type). Must use at least one do..while loop. o Must use constants as needed. No warnings or errors when you turn it in Assume all puzzles will use lower case letters and if a user enters an upper- case letter, it will reprompt them 5. Recommendations O O O You are free to implement this with your own functions. These are just some ideas for how to break up the project into smaller pieces. While not required, these are some functions that you may want to include: o Load File or Words, Populates a list of words by reading in a file. Validates that a file was found and opened o Display Puzzle - Shows the word being guessed if the letter hasn't been guessed then it shows an underscore Clear or Reset Puzzle - Clears the puzzle between games Guess Letter - Manages the user guessing a letter for the puzzle o Number Found - Counts the number of letters found in the puzzle O O 7. Sample Input and Output For this project, there is one input file named word. txt and it can be copied from my directory to yours. First navigate to your project 1 directory. Then run this command: cp /afs/umbc.edu/users/j/d/jdixon/pub/cs202/proji/* . Note: the line above goes asterisk, space, then period. This should copy all three files into your working directory. In the sample output below, user inpult is colored blue for clarity. After compiling and running proj1, here is a sample run using the default board. As you can see, it can be solved with just one move (there is an example of what happens when you choose the blank itself). Here is a simple run where the input file was valid (student@linux3 proj1]$ ./proji Welcome to EXTRA Word Guess Your file was imported! 3422 words imported. Ok. I am thinking of a word with 9 letters. 9 letters remain. What letter would you like to guess? Here is a full run where the user wins the game. (student@linux3 proji]$ ./proji Welcome to EXTRA Word Guess Your file was imported! 3422 words imported. Ok. I am thinking of a word with 9 letters. 9 letters remain. What letter would you like to guess? 8 letters remain. What letter would you like to guess? There are no e in the puzzle You have 5 bad guesses left. 8 letters remain. a What letter would you like to guess? i 6 letters remain. a i i What letter would you like to guess? There are no o in the puzzle You have 4 bad guesses left. 6 letters remain. What letter would you like to guess? n 4 letters remain. a i n in What letter would you like to guess? g 3 letters remain. a in ing- What letter would you like to guess? S 2 letters remain. a in ings What letter would you like to guess? 1 letters remain. pa in in gs What letter would you like to guess? t Congrats you won! The correct word was: paintings Another game? y Here is a run where the user loses. (student@linux3 proji]$ ./proji Welcome to EXTRA Word Guess Your file was imported! 3422 words imported. Ok, I am thinking of a word with 8 letters. 8 letters remain. What letter would you like to guess? a There are no a in the puzzle You have 5 bad guesses left. 8 letters remain. What letter would you like to guess? That letter was already guessed You have 4 bad guesses left. 8 letters remain. What letter would you like to guess? a That letter was already guessed You have 3 bad guesses left. 8 letters remain. What letter would you like to guess? That letter was already guessed You have 2 bad guesses left. 8 letters remain. What letter would you like to guess? C There are no c in the puzzle You have 1 bad guesses left. 8 letters remain. What letter would you like to guess? i 7 letters remain. i = = What letter would you like to guess? O 5 letters remain. 0 0 i What letter would you like to guess? n 4 letters remain. OO in What letter would you like to guess? g 3 letters remain. in g What letter would you like to guess? S 2 letters remain. i ngs What letter would you like to guess? m. There are no m in the puzzle You have 0 bad guesses left. Sorry, you lost The correct word was: bookings Another game? y Here is what happens when the user guesses a number. [Another game? y Ok. I am thinking of a word with 9 letters. 9 letters remain. What letter would you like to guess? 1 What letter would you like to guess? 2 What letter would you like to guess? a 8 letters remain. a What letter would you like to guess? Here is an example where the user enters a capital letter instead of lower case. Welcome to EXTRA Word Guess Your file was imported! 3422 words imported. Ok. I am thinking of a word with 10 letters. 10 letters remain. What letter would you like to guess? H What letter would you like to guess? h There are no h in the puzzle You have 5 bad guesses left. 10 letters remain. What letter would you like to guess? t There are no t in the puzzle You have 4 bad guesses left. 10 letters remain. What letter would you like to guess? A What letter would you like to guess? 9 letters remain. a