Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Hangman game source code

23/04/2021 Client: muhammad11 Deadline: 2 Day

Project 4: Hangman Overview: For this project you’ll be creating a program to play Hangman. The goal is to get practice reading files and using arrays. Description: For this project, you are going to create the game hangman. Hangman is a simple word game where the player attempts to guess a word before they get "hung" by guessing letters that they think might be in the word. For your version of the game, you’re going to use world capitals instead of words. You will randomly select a line from the file capitals.txt; you will need to have your program count how many lines are in the file and then randomly generate a number to choose which line you’ll use for the game. Your program should tell the user how many letters are in the place name by showing the appropriate number of blanks for each word. Anything that is not a letter, i.e. spaces and commas, should be displayed to the screen in original form (not as a blank). Allow the user to guess letters one at a time (in either upper or lowercase) until they get the full text or guess incorrectly 6 times. Have an interface which looks similar to the one below: _ | | | | | | --------The place is: _ _ _ _ _, _ _ _ _ _ _ _ _ _ _ _ Make a guess: a As the player makes guesses, update the display accordingly. _ | | | | | | --------The place is: _ a _ _ _, A _ _ _ a n _ s _ a n Make a guess: When the player misses, draw a new part of the person hanging from the gallows. Here is an example: _ | | * | -| | | | --------The place is: _ a _ _ _, A _ _ _ a n _ s t a n Make a guess: r r is not in the place name _ | | * | -|-| | | --------The place is: _ a _ _ _, A _ _ _ a n _ s t a n Make a guess: In this case, the right arm would have just been drawn because of the fourth miss. When the player gets a letter correct you should update the blank where that letter occurs to show where it goes (as was the case with s and n in the example above). When the game ends, tell what the word was and whether or not the player won. Here is an example: _ | | * | -|-| / \| | --------The place is: K a b u l, A f g h a n i s t a n You lost! When the game ends, give the user the option of playing again. Helpful Code and Hints: When testing your program, create a new version of capitals.txt that is smaller and easier to work with! • • printTree() – This function should print out hanging tree graphic as shown above. You will need to determine what input parameters are needed to print out the various stages of the completed diagram. You may want to create a driver program that tests out all possible options (there is only 7) readFile() – This function will need to read in the input file. You can pass the filename to the function. Make sure to validate that the file is opened successfully. If the function cannot open the file, it can exit the program. This function should return the number of capitals successfully read from the file. It also needs to update the array of capital data. If you notice, the input file contains blanks and commas. This will mess up the standard way of reading data. Use the following ▪ Option One • string name; instream.clear(); instream.ignore(); getline(instream, name);// allow for a 256 char name ▪ • Option Two • Char name[256]; • • • • instream.clear(); instream.ignore(); instream.getline(name,256); // allow for a 256 char name makeGuess() – This function will validate the user’s guess against the selected capital. It receives the array of capitals and the current string of guess progress. It can return a Boolean value depending on the success of the guess. It should also validate that the user has not already guessed a particular letter. You will want to ignore letter case issues – ‘a’ vs ‘A’. In order to do this, you can use the toLower(name[i]) function. In addition, you may need to use the .length() method on a string to determine how long the string is. Extra Credit Coding (2%) : For extra credit, you can play around with colors: if you #include the windows.h library, you can use the following command to change the color of the font to color number 13 or pink: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13); The following numbers can be used to alter the font color: 0 1 2 3 4 5 6 7 Black Blue Green Aqua Dark Red Purple Muddy Yellow White (normal font color) 8 9 10 11 12 13 14 15 Grey Light Blue Light Green Light Aqua Bright Red Pink Bright Yellow Bright White Another command you may find useful is: system("CLS"); The CLS command clears the console screen. Coding Requirements: Your program should perform user input validation. The user should not be allowed to enter illegal values (non-letters or letters that have already been guessed). If an illegal value is entered, an appropriate message should be given, and the user re-prompted. Your code should be thoroughly commented, and you should follow all of the good programming practices we have discussed in class, e.g. commenting, meaningful variable names, indentation, etc. You are not allowed to use GLOBAL VARIABLES, goto statements or exit(). Submission: Using the Sakai assignment feature, you should submit the source code (.cpp file). Make sure you submit your assignment after uploading the file attachment! ...

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Pro Writer
Math Specialist
Assignment Guru
Assignment Hut
Instant Homework Helper
Calculation Master
Writer Writer Name Offer Chat
Pro Writer

ONLINE

Pro Writer

I am known as Unrivaled Quality, Written to Standard, providing Plagiarism-free woork, and Always on Time

$35 Chat With Writer
Math Specialist

ONLINE

Math Specialist

I am known as Unrivaled Quality, Written to Standard, providing Plagiarism-free woork, and Always on Time

$27 Chat With Writer
Assignment Guru

ONLINE

Assignment Guru

I will cover all the points which you have mentioned in your project details.

$44 Chat With Writer
Assignment Hut

ONLINE

Assignment Hut

You can award me any time as I am ready to start your project curiously. Waiting for your positive response. Thank you!

$44 Chat With Writer
Instant Homework Helper

ONLINE

Instant Homework Helper

You can award me any time as I am ready to start your project curiously. Waiting for your positive response. Thank you!

$24 Chat With Writer
Calculation Master

ONLINE

Calculation Master

I have read and understood all your initial requirements, and I am very professional in this task.

$34 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Consider the queuing delay in a router buffer - Evaluate applied steel's situation what should applied steel do - What is a compound shape in maths - Bertrand russell thought philosophy was important because - Magnesium oxide experiment lab report - Which of the following statements is untrue regarding cold canvassing - Easy access continuing airworthiness - “What is the essential dividing line between human beings around the world?” - Unit IV assignment - Discussion Board - Smith and noble roman shade installation instructions - Week 7 Discussion Prompt #1 and #2 - Put call parity arbitrage opportunity example - Orac beverages llc fargo nd - Security Architecture & Design - Assignment 1 - Mat 540 assignment 1 - Are information gathering techniques like rajaratnam's common on wall street - Iron iii nitrate and potassium thiocyanate reaction - Level 2 mandatory units answers - Feminist action, answer 10 questions after reading an article - How to wire up driving lights diagram - 1.3 Discussion: Borland Case Baseline Ethics - Wk6 DQ1 Discussion Question 1 – CLO 1, CLO 2, CLO 3, CLO 4, CLO 9 - Urgent 1 - Sam newman leonie jones - Phi 445 week 1 quiz - Volvo penta v6-240 review - Chiquita brands international case study solution - Systems theory in nursing practice - Berri apple juice price in sri lanka - Flowol 4 lesson plans - Cpap in neonates ppt - Fbt operating cost method calculator - This is america music video review - 1110 toorak road camberwell - Homework - Wessex ward basingstoke hospital - Assignment - Interpersonal Communications - What are a4 envelopes called - Marketing simulation managing segments and customers - SEX TRAFFICKING - How to find variable cost with contribution margin ratio - I have a tiny turtle - Norton studyspace give me liberty 4th edition - Epsom and ewell recycling - Grandma's experiences leave a mark on your genes - Bbc bitesize the periodic table - The classical management viewpoint emphasized - No apparent distress sparknotes - Budget constraint khan academy - Mutual inductance between two magnetically coupled coils depends on - Un2800 special provision a67 - The mortex company assembles garments - Importance of pleasing god - St pancras school ipswich - Trb register of teachers - Hypodermic syringe model examples - Similes for ice cream - Virtual capacitor experiment answers - Great gatsby character quiz - Florence boot hall nottingham - Spider who helped her pig friend - 6 protons 6 electrons 6 neutrons - QUALITATIVE Journal Submit Article Reviews Here - Two types of divestitures are _____ - Are variable costs always relevant costs explain - Allen bradley 2080 lc50 24qwb manual - Aladdin once upon a time - Unit 7 Assignment - The city and green spaces - Module 2 discussion - Macquarie capital notes 2 prospectus - When a new manager stumbles who's at fault - Harvest home recreation reserve - Diagram of earth layers - PSY 361 - 4.2 - Discussion week1 - Boeing defence space and security - Unit 2 interim assessment answers grade 6 - Cyber Security - Imagitarium automatic fish feeder instructions - HSA5400-Deliverable 7 – Develop a Proposal for Health Reform - Nova vaccines calling the shots worksheet answer key quizlet - Build a bear company values - Lexicographers concern - Image lab software free download bio rad - A cold front forms when a cold air mass - 24 bogart drive wendouree - Dcc concepts ads 8fx - F half diminished 7 - Me talk pretty one day essay - Week 5 - Final Paper - Strategic Planning1 - Leadership 3: Power in Organizations - Combining nurse leader with advocacy - Complex pdu packet tracer - Rainbird 5000 filter screen cleaning - Safety and Quality Improvement in Professional Nursing Practice - Food and beverages at southwestern university football games