CS计算机代考程序代写 algorithm python Essentials of Programming – cscodehelp代写

Essentials of Programming
Assignment 2 is worth 10 points and is due Sunday 4/4 by 11:59 pm.
By taking and completing the assignment, you affirm that (1) you will not share or discuss the assignment with any individual or entity; (2) you will not collaborate with anyone on the assignment; (3) you will not engage in any action that compromises the integrity of the assignment and class; and (4) your application strictly involves your solo effort.
Create another Guess the Number game.
 Python randomly chooses a secret four-digit number (with no repeating digits) and asks the user to guess it.
 The user has up to ten attempts to guess the number. After each attempted guess, Python gives the user two clues (until the user either guesses the number correctly or runs out of attempts):
o The number of digit(s) in the user’s guess that is (are) both correct and in the right position.
o The number of digit(s) in the user’s guess that is (are) correct but in the wrong position.  For example, say the secret number is 0123.
 If the user’s guess is 4567, the clues will be: o Right digit and position: 0
o Right digit but wrong position: 0
 If the user’s guess is 1023, the clues will be:
o Right digit and position: 2
o Right digit but wrong position: 2
 If the user guesses the correct number within his/her ten attempts, the game will finish.
 If the user fails to guess the correct number within his/her ten attempts, the number will be shown and the game will finish.
 When the game finishes (i.e., whether the user guesses the correct number or fails to do so in ten attempts), Python asks the user whether he/she wants to continue playing.
o If the user enters “Y” he/she will play another round. If the user enters “N” the game will end.
Please see the next page an output sample. In this example, I played the game for two rounds and then stopped.
Please see the rubric on page 3.
Please include your entire code in one cell and upload your notebook file (.ipynb file) on blackboard.
1

Essentials of Programming
Assignment 2 is worth 10 points and is due Sunday 4/4 by 11:59 pm.
2

Essentials of Programming
Assignment 2 is worth 10 points and is due Sunday 4/4 by 11:59 pm.
Student Name:
Total points possible: 10 points
Requirements: Your application MUST at least accomplish the followings:
1. ______/1 The algorithm and logic of the application are reasonable and efficient. 2. ______/8 The application includes the functionalities suggested by the case.
a. ___/2 Randomly selects the four-digit secret number with no repeating digits.
b. ___/1 Gives the user up to ten attempts and shows each attempt number.
c. ___/2 Provides the user with proper clues.
d. ___/1 Ends if the user guesses the correct number within his/her ten attempts.
e. ___/1 Ends and shows the correct number if the user fails to guess it within his/her ten
attempts.
f. ___/1 Asks and allows the user to continue/discontinue playing at the end of each
round.
3. ______/1 The application runs without error.
Total: /10
Other comments:
3

Leave a Reply

Your email address will not be published. Required fields are marked *