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
Using C++:
Generate a random, 5 digit number as a string.
The player needs to try to guess this 5 digit number.
The program should provide feedback to the player letting them know if they got any of the digits correct, using the Feedback Key (or hints) below:
1 = indicates Right Number, Right Place.
2 = indicates Right Number, Wrong Place.
0 = indicates Wrong Number.
For example:
If the computer program generates 12345 as the random number.
The player needs to make guesses in order to figure out what the secret, random number is. If the player guesses 11235, the computer should respond with the feedback code of: 10221.
Repeat step 2 and 3 until the player guesses the whole 5 digit number correctly (or, you can allow the player to do 10, 15, 20 tries).
If the player guesses it correctly, display the message "You guessed it correctly!" If the player doesn't guess it within the limited number of tries, display the message "You couldn't guess it. Game over."
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