subject

Program Specifications Your program will play the mastermind game as follows:
1. Prompt for the 4 digit key we will play with.
2. Prompt the user for a guess.
a. we check to see if the guess is exactly length 4
b. we check to see if the guess contains all numbers
C. we check to see if the guess has no repeats
Any violation of these rules prints an error message and prompts for a guess again. Bad input does not
count as a guess.
3. End the game if:
a. the guess is correct. Print out a winner message
b. it was the last guess (the twelfth) and the guess is incorrect. Print out a loser message and the
value of the key
4. If no end condition occurs, print out how many of the guess numbers are exactly right (correct number in the
correct position) and how many of the guess numbers are correct but not in the correct position. Example. The
key is 1234 and the guess is 4256. The feedback would be 1 number exactly correct (2) and 1 number in the
wrong position (4). That is, each digit in the
guess produces at most one result (exact or wrong position).
5. You should keep a history of guesses so that the user can see how they are progressing.
6. Continue the game until an end condition occurs

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
What type of weird relationship this is analogy show? dissolve: solidify: : noise: silence
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
Which component acts as a platform on which application software runs
Answers: 2
question
Computers and Technology, 24.06.2019 15:50
Andy would like to create a bulleted list. how should he do this? andy should click on the bullet icon or select the bullet option from the menu and then type the list. andy should press the shift key and the 8 key at the beginning of each line of text. andy should type the text and then click on the bullet command. andy should press return and the bullets will automatically
Answers: 2
question
Computers and Technology, 25.06.2019 00:00
When pasting an existing chart into a word document, you can choose to using the paste options button. a. paste the chart as a picture b. embed the chart c. add the chart while keeping the destination formatting intact d. insert the chart while keeping the source formatting intact
Answers: 1
You know the right answer?
Program Specifications Your program will play the mastermind game as follows:
1. Prompt for...
Questions
question
English, 05.01.2020 01:31
question
Social Studies, 05.01.2020 01:31
Questions on the website: 13722359