Welcome to Premium Paper Help

PLEASE REVIEW THE INFO Homework 7 Upload your .cpp source code file to Ecampus. This program is a word/phrase guessing game

PLEASE REVIEW THE INFO

Homework 7

Upload your .cpp source code file to Ecampus.

This program is a word/phrase guessing game similar to the classic hangman game.  You should put your own theme (not hangman) onto the game.  All screens should include ASCII art that matches your theme.  The game should include:

1. Introduction screen that has your name and introduces your theme (includes ASCII art)

2. Winning and losing screens (includes ASCII art)

3. Game loop that displays ASCII art that changes with each incorrect guess.

4. Letters guessed or remaining

Steps in the program:

1. Introduction Screen

2. Select a random word and store it in a string variable name SecretPhrase

3. Create GuessPhrase which will be the same size as SecretPhrase, but all periods (e.g. “. . . . . . . .”)

string GuessPhrase = SecretPhrase;
for (int x = 0; x < SecretPhrase.size(); x++)
{
   if (SecretPhrase[x]==’ ‘)
      GuessPhrase[x] = ‘ ‘;
   else
      GuessPhrase[x] = ‘.’;
}

4. Declare an integer named BadGuesses = 0
    Declare a string named Letter
    Declare a string named LettersRemaining and make it equal to the alphabet
    Declare an integer named Location

5. Set up a while loop for steps 6 – 10.  This is the main loop of the program.  The game keeps playing as long as you haven’t lost (when BadGuesses = 6) and you haven’t won (when GuessWord = SecretWord).

{      // This is the opening brace for the game loop

     6. Display ASCII art graphics (do this step last)

     7. Display letters remaining

     8. Output GuessPhrase

     9. Prompt player to enter a letter (their guess) and store it in the variable Letter.  Remove this letter from LettersRemaining.

     10. If Letter is not located in SecretPhrase (note: use Letter.find( ), increment BadGuesses

         Else continue looping and find all occurrences of Letter in GuessWord and replace the periods. 

  // Step 10
  Location = SecretPhrase.find(Letter,0);
    if (Location == -1) // not found
      BadGuesses++;
    else
      while (Location < SecretPhrase.size())
    {
      GuessPhrase.replace(Location,1,Letter);
      Location = SecretPhrase.find(Letter, Location + 1);
     }

}

11. If you exit the loop, then you’ve either won or lost.  Therefore, if BadGuesses == 6, then display the losing screen, else display the winning screen.

Extra Credit Ideas

(a) Outstanding graphics and theme
(b) Ask the user to select a subject for their secret word – e.g. college, movies, etc.
(c) Make your program work with capitalized letters in the secret phrase.

NOTE:

USES OF ANY LIBRARIES(WHICH I HAVE REPEATED MANY TIMES WILL BE GRADED 0) THIS ASSIGNMENT WILL COVER 40 % OF YOUR GRADE) USE OF ANY AI WILL BE DETECTED ) THIS IS THE FINAL WARNING TO ANY WHO USED AI BEFORE .

I ALSO HAVE NOTED DOWN THE EXAMPLE OF HOW ONE OF THE STUDENT DID IT .

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Module 4 – Case CHALLENGES OF GLOBAL HRM Assignment Overview Please read: Phillips, J., Farndale, E., Horak, S., & Beamond, M. (2019). Facing

Module 4 – Case CHALLENGES OF GLOBAL HRM Assignment Overview Please read: Phillips, J., Farndale, E., Horak, S., & Beamond, M. (2019). Facing complexity, crisis, and risk: opportunities and challenges in international human resource management. Thunderbird International Business Review, 61(3), 465–470. Available in the Trident Online Library. Retrieved from EBSCO

Accessibility Assignment: (30 points) Due: March 24th, 2024 11:59 PM EST  This assignment addresses your Global Awareness Outcome, Students will be

Accessibility Assignment: (30 points) Due: March 24th, 2024 11:59 PM EST  This assignment addresses your Global Awareness Outcome, Students will be able to conduct a multi-perspective analysis (locally and internationally) of physical and programmatic accessibility for people with disabilities within the context of recreation, leisure, and sport facilities. The purpose

Read why color doesn’t exist. (An additional resource about visual information and the role of brain processing that might help

Read why color doesn’t exist. (An additional resource about visual information and the role of brain processing that might help you Listen to Anil Seth describe perception: How does your brain construct your conscious reality (transcript at this link) Answer questions Examine the pictures of flowers above, the first in visible light and the second in ultraviolet

  Health professionals use the Pain scales for assessment during hospital visit, out-patient/in-patient procedures etc. Patients typically self-reports

  Health professionals use the Pain scales for assessment during hospital visit, out-patient/in-patient procedures etc. Patients typically self-reports their pain using a specially designed scale from 0 to 10 to indicate pain level. Health experts use the pain scale to better identify/recognize certain aspects of the patient pain-level, including pain

Due 8/8/2024 For this assignment, you should  build on previous assignments and discussion postings to create a comprehensive program

Due 8/8/2024 For this assignment, you should  build on previous assignments and discussion postings to create a comprehensive program evaluation plan. Using the program you have identified in assignments #1 and #2 (Community-Based Correctional Program (CBCP)), discuss the following aspects in detail:  description of the program and population served, activities