GuessMyNumber_Week5

Ratings: 1 Star2 Stars3 Stars4 Stars5 Stars (5.00 out of 5) - Rate Now!
Loading...

Download Category:

GuessMyNumber_Week5_Documentation.zip - (322.34 KB)
[
GuessMyNumber_Week5_Documentation/GuessMyNumber.png
GuessMyNumber_Week5_Documentation/GuessMyNumber_Week5_Documentation.docx
GuessMyNumber_Week5_Documentation/Question.txt
]

Guess the Number Week 5
You will add to the program you created in Week 4. This week you will add input validation and a count to show how many guesses the user took before getting the correct number. Be sure to import random at the beginning of your code and use a comment block explaining what your program does.
Pseudocode:
#Guess the number week 5
#Name:
#Date:
#Random number, loop while true
#ask user for number. Check to see if the value is a number between 1 and 10
#if number is too high or too low, tell user, if they guessed it break out of loop
Display “Welcome to my Guess the number program!”
random mynumber
count=1
while True
try
Display “Guess a number between 1 and 10”
Get guess
while guess<1 or guess>10
Display “Guess a number between 1 and 10”
Get guess
except
Display “numbers only”
continue
if (guessmynumber)
Display “Too high”
count=count+1
else if (guess==mynumber)
Display “You guessed it in “+ count + ” attempts”

Expected Result of Program:

Get a fresh solution of this question. Ask it now to our experts.
doubt

Ask Your Question

We have verified professionals who are ready to answer your question.

time

Save Time and Money

We choose experts who can quickly answer your question and that suit your budget.

download

Get Your Answer

Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.