Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Word Scramble is a puzzle game in whichthe computer creates a version of a word

ID: 3608142 • Letter: W

Question

Word Scramble is a puzzle game in whichthe computer creates a version of a word where the letters are inrandom order. The player has to guess the word to win the game. Ifthe player is stuck, he can ask for a hint. Use the followingguidelines:

1) Declare and initialize atwo-dimensional array where each row and hint combination is in onerow of the array: words in the first column and its hints in thesecond column.

2) Read in the words and hints from aninput file. In the file, the word appears first followed by itshint. The word and its hint are contained on a single line (e.g.ends with the end of line character). An example follows: footballA game that was tried by the Lions software Tells the computer whatto do

3) Pick a random word from thearray.

4) Scramble the word. One possibility isto make a copy of the word, choose two random positions and swapthe characters at those positions. Do this severaltimes.

5) Use a loop to prompt the user for thecorrect word until he either guesses the word or asks to quit. Theuser should be allowed to request a hint. Allow the user to make 5guesses before giving him/her the actual word.

6) Ask the user whether they want toquit the game.

Page 2

a) If they want to play again, repeatsteps 2-4 again making sure you do not give the same word again (If the user repeats the game such that all words have beendisplayed, merely give a word that has been displayedagain.)

b) If the user wants to quit, display acount of the number of successful and unsuccessfulguesses.

Explanation / Answer

please rate - thanks #include #include #include using namespace std; string jumbleString(string); int main() {string word[50][2], wd,wordguess; int i=0,j,count=0,guess,used[50]={0}; char answer; ifstream in; in.open("scrabble.txt");          //open file   if(in.fail())            //is it ok?        { cout word[count][0];    while(in)             { getline(in,word[count][1]);        count++;        in >>word[count][0];      } answer='Y'; while(toupper(answer)=='Y')     { i=0;       for(j=0;j
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote