The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 5 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
write a hangman's program where the player is a computer that has to guess the word JAVA. the computer uses brute force method
1)the user is prompted to input the word, The comp stores the word(and counts the number of letters in it) , labels it correct or incorrect and also draws the result (line by line, circle by circle) when the guess is wrong. the computer guesses the word trying each letter of the alfabet from start to finish but does not retry letters already tried,if there is more than one letter that is the same like A in JAVA each occurrence of the letter is deemed to have been guessed and need not be tried again. at the end of the game the program prints the total number of guesses it took to win or lose the gameYhe comp draws both the gallows and the victim
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll