Complete the following tasks: a. In Chapter 5, you created a game named GuessAWord that is similar to Hangman and in which a player guesses letters to try to replicate a hidden word. At the end of the...



Complete the following tasks:


a. In Chapter 5, you created a game named GuessAWord that is similar to Hangman and in


which a player guesses letters to try to replicate a hidden word. At the end of the game, a


count is displayed indicating the number of entries that were required for the player to guess


the word. Now modify the program to throw and catch an exception when the user enters a


guess that is not a letter of the alphabet. Create a NonLetterException class that descends


from a built-in exception class that can store and retrieve the non-alphabetic entered


character. Modify the GuessAWord program so that when a NonLetterException is


thrown and caught, an appropriate message is displayed for the user informing the user that


the character entered was not a letter and displaying the entered character. Save the file as


GuessAWord2.cpp.


b. Modify the GuessAWord2 game so that when the player enters a non-alphabetic guess, not


only is the player notified of the mistake, but also do not have the guess count as part of the


final total of number of guesses made. Save the file as GuessAWord3.cpp.



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here