Computers and Technology
Computers and Technology, 22.04.2021 19:50, Tripz3005

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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:30, jacob7542
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
image
Computers and Technology, 22.06.2019 23:30, Nason156
What are some ways to use a range name in a formula? check all that apply. in the defined names group, click use in formula, and then select the desired name. begin typing the name in the formula, select a name from the autocomplete list, and use the arrow keys and tab key to enter the name in the formula. begin typing the formula, and then click and drag with the mouse to select the cells to include in the formula. right-click one of the cells in the range. click formula options, and use the dialog box to add the name.
Answers: 1
image
Computers and Technology, 23.06.2019 00:00, destinysmithds7790
Suppose you have 9 coins and one of them is heavier than others. other 8 coins weight equally. you are also given a balance. develop and algorithm to determine the heavy coin using only two measurements with the of the balance. clearly write your algorithm in the form of a pseudocode using the similar notation that we have used in the class to represent sorting algorithms
Answers: 1
image
Computers and Technology, 23.06.2019 10:50, Leffew
The volume v and paper surface area a of a conical paper cup are given by where r is the radius of the base of the cone and h is the height of the cone. a. by eliminating h, obtain the expression for a as a function of r and v. b. create a user-de ned function that accepts r as the only argument and computes a for a given value of v. declare v to be global within the function. c. for v ! 10 in.3 , use the function with the fminbnd function to compute the value of r that minimizes the area a. what is the corresponding value of the height h? investigate the sensitivity of the solution by plotting v versus r. how much can r vary about its optimal value before the area increases 10 percent above its minimum value?
Answers: 1
Do you know the correct answer?
Program Specifications Your program will play the mastermind game as follows:
1. Prompt for...

Questions in other subjects: