Question: Program is to be written in c++ here are the directions: You are basically coding for a game called Word predict you need a Dictionary

Program is to be written in c++ here are the directions:

You are basically coding for a game called Word predict

you need a Dictionary class that represents a jar of words, the size of jar isn't known when the object is created/instantiated

-you need a State method or object: it represents a jar of words.

-you need a behavior method or object object: it occupates the jar with the console, it occupates the jar with a file, and gets a random word from the jar

You also need a player class- it acts for a player of a game.

-you need a State method or object: has the name of player, quantity of wins and losses.

-you need a Behavior method or object: tangible thing behavior (i don't know what he means by that but its there.)

You also need a gamestate class - it shows the predicament of one game of word guess

you need a State method or object: current word being played, current state of the users guessed word, letters incorrectly guessed, words incorrectly guessed, number of attempts left

you need a Behavior method or object: matches the user guess to the present word, it is in charge for acquiring all state information

The game should be played like this:

colonize the dictionary of words. A word cannot have a space. You can colonize the dictionary reading in words from the console or from a data file. You have to allow the user to choose how they want to colonize the file. you need to make sure both choices work and the user is allowed to choose any number of words. you probably will need a sentinel loop pattern. you need to make sure the dictionary is colonized before the player is asked to play. you are allowed to presume valid data.

you have to prompt the user whether or not they want to play. you have to make sure the player can replay without running the program over again (the same loop pattern again!)

the way the game works is that a word is randomly picked from the dictionary of words. You have to make sure that the word is shown to the player as a set of space delimited dashes . make sure that each dash represents a character in the word. Make sure that the player is allowed the same number of tries as the characters of the word.

here is a model: say the word is dell, the player can guess up to four times. the amount of tries is per character not per special character. make sure that that player is allowed to guess one letter or the entire word. Each time a player tries to make a guess, it counts, even if they enter the same thing over again. The player wins by getting the word right or all the letters right before they run out of tries.

Make sure that after attempt is made you have show the present state of the guessed word, the number of tries remaining, and a list of words and letters that were previously entered (make sure to display letters that are correct that the player has entered as well).

when the game is done, tell the player if they won or lost and display the correct word. When the player doesn't want to play anymore, display to them their win loss record.

don't create any additional classes.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!