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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:00
What is added to the < meta > tag to describe the encoding type?
Answers: 2
question
Computers and Technology, 22.06.2019 19:30
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
What process should be followed while giving a reference? sam has given a reference of his previous manager in his resume. sam should him in advance that the potential employers will him.
Answers: 1
question
Computers and Technology, 25.06.2019 10:20
(programming exercise 3-10). a retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. the state sales tax rate is 4 percent and the county sales tax rate is 2 percent. design a modular program that asks the user to enter the total sales for the month. from this figure, the application should calculate and display the following: - the amount of county sales tax - the amount of states sales tax - the total sales tax (county plus state) some of the code has already been provided below. complete the missing code below. // global constants for tax calculations constant real county_tax_rate = .02 constant real state_tax_rate = .04 // main module module main() // local variables declare real monthsales, countytax, statetax // get month sales display “enter monthly sales: ” input monthsales // write the statement to calculate county tax // write the statement to calculate state tax // display tax amount call showtaxes(monthsales, countytax, statetax) end module // the showtaxes module accepts monthsales, countytax, statetax // as arguments and displays the resulting data // write the showtaxes module
Answers: 2
You know the right answer?
Your program will choose a random 4 digit number as the secret number. Your program must prompt the...
Questions
question
Mathematics, 14.04.2021 14:00
question
Geography, 14.04.2021 14:00
question
Social Studies, 14.04.2021 14:00
question
Mathematics, 14.04.2021 14:00
Questions on the website: 13722361