odify the Word Jumble Program (below) 1. Allow the player to continue playing af
ID: 3659143 • Letter: O
Question
odify the Word Jumble Program (below) 1. Allow the player to continue playing after they guess a word. (loop) 2. Initially accept the words and hint and store them into the array. (cin/getline) 3. Make some type of scoring system. (less points if you need a hint, deduct for wrong guesses...) // Word Jumble // The classic word jumble game where the player can ask for a hint #include #include #include #include using namespace std; int main() { enum fields {WORD, HINT, NUM_FIELDS}; const int NUM_WORDS = 5; const string WORDS[NUM_WORDS][NUM_FIELDS] = { {"wall", "Do you feel you're banging your head against something?"}, {"glasses", "These might help you see the answer."}, {"labored", "Going slowly, is it?"}, {"persistent", "Keep at it."}, {"jumble", "It's what the game is all about."} }; srand(time(0)); int choice = (rand() % NUM_WORDS); string theWord = WORDS[choice][WORD]; // word to guess string theHint = WORDS[choice][HINT]; // hint for word string jumble = theWord; // jumbled version of word int length = jumble.size(); for (int i=0; i<< " Welcome to Word Jumble! "; cout << "Unscramble the letters to make a word. "; cout << "Enter 'hint' for a hint. "; cout << "Enter 'quit' to quit the game. "; cout << "The jumble is: " << jumble; string guess; cout << " Your guess: "; cin >> guess; while ((guess != theWord) && (guess != "quit")) { if (guess == "hint") cout << theHint; else cout << "Sorry, that's not it."; cout <<" Your guess: "; cin >> guess; } if (guess == theWord) cout << " That's it! You guessed it! "; cout << " Thanks for playing. "; int pause; cin>> pause; return 0; }Explanation / Answer
// Game Stats 2.0 // Demonstrates arithmetic operations with variables #include using namespace std; int main() { unsigned int score = 5000; coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.