subject

Your program will choose a random 4 digit number as the secret number. Your program must prompt the user to enter a 4 digit number as their guess. The program will respond with a message indicating how many of the digits in the user's guess are the same as the digit in the same position in the secret number. For example, if the secret number is 3749, and the user's guess is 9753, then the program would respond with the message You matched 1, because only one of the digits (the 7) in the user's guess is the same as the digits in the same position in the secret number. The program will allow the user to continue to enter guesses until they guess the correct secret number. mere presente la memories more than more than After the user has entered the secret number, the programevill output a count of the total number of guesses the user took to find the secret number. Then the program will ask the user if they would like to play again. If the user answers "yes", then the program will choose another random 4 digit number and play continues as described above. Here's an example interaction (user input in bold): MASTERMIND Guess the 4 digit number! Guess 1: 0000 You matched 0 Guess 2: 1111 You matched 1 Guess 3: 1234 You matched 1 Guess 4: 2444 You matched 2 Guess 5: 1442 You matched 4 Congratulations! You guessed the right number in 5 guesses. Would you like to play again (yes/no)?

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:20, eagles2286
The reset circuit used on the four 3-bit counters analyzed in this activity reset the counts to zero (000). it makes sense for the up-counters to start at zero (000), but the down-counters should start at seven (111). what would you need to change so that the 3-bit binary down counter with j/k flip-flops you just created would reset to seven (111)?
Answers: 1
image
Computers and Technology, 22.06.2019 07:30, DivineMemes420
What type of computer network ensures high security ?
Answers: 1
image
Computers and Technology, 23.06.2019 04:20, RandomLollipop
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
image
Computers and Technology, 24.06.2019 00:50, anthonycraig0205
3. what is the output of the following statements? temporary object1; temporary object2("rectangle", 8.5, 5); temporary object3("circle", 6, 0); temporary object4("cylinder", 6, 3.5); cout < < fixed < < showpoint < < setprecision(2); object1.print(); object2.print(); object3.print(); object4.print(); object1.set("sphere", 4.5, 0); object1.print();
Answers: 1
You know the right answer?
Your program will choose a random 4 digit number as the secret number. Your program must prompt the...

Questions in other subjects:

Konu
Health, 26.10.2021 15:00