Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Follow the instructions for starting your C++ development tool. Depending on the development tool you are using, you may need to create a new project;

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Follow the instructions for starting your C++ development tool. Depending on the development tool you are using, you may need to create a new project; if so, name the project Lab13-2 Project and save it in the Cpp8\Chap13 folder. Enter the instructions shown in Figure 13-30 in a source file named Lab13-2.cpp. (Do not enter the line numbers.) Save the file in either the project folder or the Cpp8\Chap13 folder. Now follow the appropriate instructions for running the Lab13-2.cpp file. Test the program using an original word that does not contain exactly five characters. Also test the program using the words and letters shown in Figures 13-31 and 13-32. If necessary, correct any bugs (errors) in the program

LAB 13-2 Plan and Create In this lab, you will plan and create an algorithm for Mr. Coleman. The problem specification, IPO chart information, and C++ instructions are shown in Figure 13-29. Problem specification Mr. Coleman teaches second grade at Hinsbrook School. On days when the weather is bad and the students cannot go outside to play, he spends recess time playing the Guess the Word game with his class. The game requires two people to play. Currently, Mr. Coleman thinks of a word that has five letters. He then draws five dashes on the chalkboardone for each letter in the word. One student then is chosen to guess the word, letter by letter. When the student guesses a correct letter, Mr. Coleman replaces the appropriate dashles) with the letter. For example, if the original word is moose and the student guesses the letter o, Mr. Coleman changes the five dashes on the chalkboard to 00-. The game is over when the student either guesses all of the letters in the word or makes 10 incorrect guesses, whichever occurs first. Mr. Coleman wants a program that allows two students to play the game on the computer Figure 13-29 Problem specification, IPO chart information, and C++ instructions for Lab 13-2 (continues) (continued C++ instructions IPO chart Information Ingut viginal word (frow.player) Letter from player 2) string origWord - ""; string letter - ""; Processing Variable that loops track of whether a dash was replaced 'N' char dashReplaced - 'N': Vorod that letadle of whether the cat is over 'N' char gameOver-'N'; www.ber of incorrect guesses int numincorrect - 0: Output) display word (5 dashes who the program begins) string displayWord - ". .." Algorithm 1. pat will the vigin word does wot cont a ctly five characters) gotovigival word Write while (origWord, length - 5) cout >letter: for (int x - 0; x on 6 //include 7 using namespace std; your development tool may require this direcive to use the Satan 9 int main string origward " string letter - ""; char dashReplaced - 'N'; char game Over - 'N' int numIncorrect = 0; string displayWard -"-----": 19 //get original word while (origWord. length - 5) cout > letter: //search for the letter in the original word for (int x=0; x >letter: for (int x - 0; x on 6 //include 7 using namespace std; your development tool may require this direcive to use the Satan 9 int main string origward " string letter - ""; char dashReplaced - 'N'; char game Over - 'N' int numIncorrect = 0; string displayWard -"-----": 19 //get original word while (origWord. length - 5) cout > letter: //search for the letter in the original word for (int x=0; x

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Define Administration and Management

Answered: 1 week ago

Question

Define organisational structure

Answered: 1 week ago

Question

Define line and staff authority

Answered: 1 week ago

Question

define the term outplacement

Answered: 1 week ago

Question

describe the services that an outplacement consultancy may provide.

Answered: 1 week ago