Our Services

Get 15% Discount on your First Order

[rank_math_breadcrumb]

HW 7

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

CSIA 310 wk2 discussion

  Write a short “newsletter” article (3 to 5 paragraphs) for the non-technical managers and employees at Sifers-Grayson to explain the following: (a) What is Phishing? (Focus on phishing emails and targeted attacks that include spear phishing and whaling.) (b) What “bad things” can happen when a successful phishing attack

Project 3

To complete this assignment, review the prompt and grading rubric in the Project Three Guidelines and Rubric. When you have finished your work, submit the assignment here for grading and instructor feedback.

digital marketing

 Digital marketing involves promoting products and services using online platforms.The goal is to increase brand awareness and drive sales 

WEEK 2 DISCUSSION MR

 I UPLOADED IN THE FILE HOW THE ASSIGNMENT SHOULD FLOW AND ALSO THE ACCEPTABLE TOPICS FOR MY PROGRAM THAT U CAN SELECT FROM!  INSTRUCTIONS!! This week you considered study topics deemed acceptable for your program. For this discussion, share with your peers your initial thoughts on a topic you’d like

wk 2 practice models

INSTRUCTIONS!! Discuss the various practice models discussed in Chapter 3 of The Ernst and Young Business Plan GuideLinks to an external site.. What model is the most attractive for your own consultancy? Why? Do you see the model for your practice changing in the future?   READ CHAPTER 3!! OF THE

Computer Science Sustainable Development Goal and Mobile App Assignment

ATTACHED IS THE COPIED STATEMENT ON INTEGRATION OF FAITH AND WORK A s a university, we believe that the message of Jesus Christ bears profound implications, not only for individuals, but also for society and the ways that we as individuals live within it. The Lord Jesus instructed His followers

Intro Pogramming

After viewing the videos and listening to the information on programming, you should be ready to answer the questions listed below.     Your assignment is as follows:  I.   Access the Youtube videos:    Introduction to Programming Fundamentals (by Neso Academy).  You will be responsible for accessing the first 3 videos in

Disruptive technology and its impact on society (Discussion)

A discussion on disruptive technology and its impact on society 1) Discussion 1: Write a reflective response to the lesson on disruptive technology and its impact on society. (200-word minimum) Explore the impact on a macro and micro level looking at the impact on systems and structures as well as the

week 1 begin your

 I am a Kroger fulfillment delivery driver trainer / and I am also a TECH SUPERVISOR for spectrum whichever job you find easier to discuss about share something from your profession, job, or other source of inspiration that generated the idea for your project. What do you want to learn

project 2

To complete this assignment, review the prompt and grading rubric in the Project Two Guidelines and Rubric. When you have finished your work, submit the assignment here for grading and instructor feedback. For reference, refer to the CIA Triad and Fundamental Security Design Principles PDF document.

project 1

To complete this assignment, review the prompt and grading rubric in the Project One Guidelines and Rubric. When you have finished your work, submit the assignment here for grading and instructor feedback.

Final SWOT presentation

Concepts and Applications of Information Technology (IFSM201) Class Project Purpose of this Assignment The Class Project is the most significant assignment in this course, Concepts and Applications of Information Technology. As such, it accounts for 58% of the course points. This assignment is comprised of two deliverables: a SWOT Analysis

Wk4_411

Need help with a question. Due 10/7/2024 Based on your research, readings, and this week’s Learning Team assignment, create a 4- to 5-page sample penetration agreement for a banking institution using the major sections listed below and the purpose of each section. Include examples within each section. The major sections

Discussion 7 Social Networking

  Discussion Seven – Social Networking Social networking Web sites create online communities of Internet users that eliminate barriers created by time, distance, and cultural differences. These sites allow people to interact with others online by sharing opinions, insights, information, interests, and experiences.  Members may use the site to interact

Cap assign

Unit III Scholarly Activity Top of Form Bottom of Form Assignment Content Top of Form Purpose, Subject, Object, and Ethics In this unit, you will determine the purpose, subject, object, and ethical considerations of your case study, then assemble your findings in the  Unit III Case Study Outline Template .

project 3:

Support Queue Case Study Instructions:  Select two tickets from each level and explain how you would solve them. Name:  Level 1 Tickets Instructions:  Select two of the five scenarios to troubleshoot.  One template has been created for each of the two tickets you need to choose.  Make one to two

case

Write three pages of high-quality content for this case study, using the concepts discussed in class and any relevant external resources to support your analysis. Follow the instructions for your research problem carefully, as your argument and research will significantly impact your grade. Ensure that AI patterns do not exceed