Question

In: Computer Science

Draw a structured flowchart or write pseudocode that describes the process of guessing a number between...

Draw a structured flowchart or write pseudocode that describes the process of guessing a number between 1 and 100. After each guess, the player is told that the guess is too high or too low. The process continues until the player guesses the correct number. Pick a number and have someone try to guess it by following your instructions. Submit the flowchart or pseudocode and the results of your test. Create a python program based on your flowchart or pseudocode. The language is python

Solutions

Expert Solution

GIVEN THAT:

Draw a structured flowchart or write pseudocode.

To describes the process of guessing a number between 1 and 100.

pseudocode 
(i) Generate a random number between 1-100 store value in num of integer type
(ii) define a flag match and initialize to False
(iii) Initiate a loop until match is found
(iv) Within loop
(v) prompt user to guess a number 
        (a) if guess == num
            print winning message
            and set flag to true
        (b) if guess > num
            print too high message
        (c) if guess < num
            print too low message
(vi) end the program
"""
import random

# generate number between 1 -100
num = random.randint(1, 100)
match = False
while not match:
    guessNumber = int(input("Guess a number: "))
    if guessNumber == num:
        print("Hurray!!! You found the number.")
        match = True
    elif guessNumber > num:
        print("guess is too high.")
    else:
        print("guess is too low.")

Related Solutions

i could use the flowchart and pseudocode solutions for the following: 1.       1.  Draw a structured flowchart describing...
i could use the flowchart and pseudocode solutions for the following: 1.       1.  Draw a structured flowchart describing the steps you would take to bake pancakes in a pan.  Include at least one decision. 2.       2.  Create the pseudocode to go along with the flowchart created in question above.
6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart...
6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart for each of the following problems: a) Obtain three numbers from the keyboard, compute their product and display the result. b) Obtain two numbers from the keyboard, and determine and display which (if either) is the smaller of the two numbers. c) Obtain a series of positive numbers from the keyboard, and determine and display their average (with 4 decimal points). Assume that the...
All program should be in C Write its pseudocode and draw its flowchart) to prompt the...
All program should be in C Write its pseudocode and draw its flowchart) to prompt the user to input the variables to solve the following problem: X2 + X×Y/Z - W*V3 Note 1: You should ask the user to input 5 numbers to be able to do this calculation. Note 2: You can use multiplication instead of power if you do not want to use it (as we have not officially covered it). Write a program (compile and run), pseudocode,...
DESIGN A FLOWCHART IN FLOWGORITHM AND WRITE THE PSEUDOCODE Number Analysis Program Design a program that...
DESIGN A FLOWCHART IN FLOWGORITHM AND WRITE THE PSEUDOCODE Number Analysis Program Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: The lowest number in the array. The highest number in the array. The total of the numbers in the array. The average of the numbers in the array. PLEASE AND THANK YOU
-Draw a flowchart and pseudocode for a program that produces a monthly bill for a cell...
-Draw a flowchart and pseudocode for a program that produces a monthly bill for a cell phone customer. -List at least 10 separate modules that might be included. - For example, one module might calculate the charge for daytime phone minutes used. - -Make a working version of this program using Python. Need all of the above answered including the correct code for program using python
JAVA Write a number guessing game that will generate a random number between 1and 20 and...
JAVA Write a number guessing game that will generate a random number between 1and 20 and ask the user to guess that number. The application should start by telling the user what the app does. You should then create the random number and prompt the user to guess it. You need to limit the number of times that the user can guess to 10 times. If the user guesses the number, display some message that tell them that they did...
Draw a flowchart and pseudocode that accepts three numbers from a user and displays a message...
Draw a flowchart and pseudocode that accepts three numbers from a user and displays a message if the sum of any two numbers equals the third. Make a working version of this program in Python.
Using pseudocode design a number guessing game program. The program should generate a random number and...
Using pseudocode design a number guessing game program. The program should generate a random number and then ask the user to guess the number. Each time the user enters his or her guess, the program should indicate it was too high or too low. The game is over when the user correctly guesses the number. When the game ends, the program should display the number of guesses that the user made.
Random Number Guessing Game Write a program in C++ that generates a random number between 1...
Random Number Guessing Game Write a program in C++ that generates a random number between 1 and 100 and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high. Try again.” If the user’s guess is lower than the random number, the program should display “Too low. Try again.” The program should use a loop that repeats until the user correctly guesses the random number....
Random Number Guessing Game C++. Write a program that generates a random number between 5 and...
Random Number Guessing Game C++. Write a program that generates a random number between 5 and 20 and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display Too high. Try again. If the user’s guess is lower than the random number, the program should display Too low, Try again. The program should use a loop that repeats while keeping a count of the number of guesses...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT