Menu

[Solved]Include Include Include Using Nanespace Atd Const Int Guess Limit 6 Bool Checkguess String Q37298278

the input .txt file contains;5hamburgergestaltzeitgeistderivativehyperplane
#include <iostream> #include <fstream> #include <ctime> using nanespace atd: const int GUESS LIMIT-6 bool checkGuess (stringWrite a void function: getword(string &word) that will choose a random word from the list you created and return it in the wo#include <iostream> #include <fstream> #include <ctime> using nanespace atd: const int GUESS LIMIT-6 bool checkGuess (string word, char quess, bool matchedI1) void displayGameState (string word, bool matched11. int guesses) void gethord (string sword) bool hasWon (bool matched[, int length) int main 0 int guesses-0: string word: gethord (word) : bool matched [vord. length 01: char quess: //initialize matched array for (int í “ 0; í < word. length ( ); i++) matched(i] -false: //Gane Loop do displayGameState (word, matched, guesses) cout < “Choose a letter: ein > guessi cin.clear OF cout <c endl << endl; if (!checkGuess (word, guess, matched)) guesses++ if( hasWon (matched, word. lengtho) displayGameState (word, matched, guesses); coutくくword << “You win !” << endl; return 0 while{guesses < GUESSLIMIT); – cout << “You lose, the word was ” <<word <<“.” << endl; Write a void function: getword(string &word) that will choose a random word from the list you created and return it in the word parameter. Use the file reading techniques you learned in class and the random number generator from lab 7. Write a bool returning function: hasWon (bool matched[], int length) The function should check to see if all the elements of matched are true. If all values are true, it should return true. If even one value is false, it should return false. If you have not already done so, make sure that checkGuess () and displayGameState() from the last lab are complete. Show transcribed image text #include #include #include using nanespace atd: const int GUESS LIMIT-6 bool checkGuess (string word, char quess, bool matchedI1) void displayGameState (string word, bool matched11. int guesses) void gethord (string sword) bool hasWon (bool matched[, int length) int main 0 int guesses-0: string word: gethord (word) : bool matched [vord. length 01: char quess: //initialize matched array for (int í “ 0; í

Expert Answer


Answer to #include #include #include using nanespace atd: const int GUESS LIMIT-6 bool checkGuess (string word, char quess, bool m… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *