1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lina2011 [118]
3 years ago
10

Write a program that has a user guess a secret number between 1 and 10. Store the secret number in a variable called secretNumbe

r and allow the user to continually input numbers until they correctly guess what secretNumber is. Complete the method guessMyNumber that uses a while loop to ask the user for their guess and compares it againist secretNumber. For example, if secretNumber was 6, an example run of the program may look like this:_______.
Computers and Technology
1 answer:
Tom [10]3 years ago
5 0

Answer:

Explanation:

The following code is written in Python. It is a function called guessMyNumber and like requested creates a random number and saves it to secretNumber. Then it continuously asks the user for their guess and compares it to the secret number. If the guess is correct it exits the loop otherwise it will continue to ask for a new guess.

import random

def guessMyNumber():

   secretNumber = random.randint(1, 10)

   print(secretNumber)

   while True:

       guess = input("Enter your guess: ")

       guess = int(guess)

       if (guess == secretNumber):

           print("Congratulations you guessed correctly")

You might be interested in
Computer programs typically perform three steps: input is received, some process is performed on the input, and output is produc
-Dominant- [34]
True. Most basic programs follow this structure.
6 0
1 year ago
What gonna happened if you put rice water in your hair
Nikitich [7]

Answer:

That does something?

Explanation:

(•_•)

<) )╯all the single ladies

/ \

(•_•)

\( (> all the single ladies

/ \

(•_•)

<) )╯oh oh oh

/ \

7 0
3 years ago
Which alignment aligns text to the left and right side margins?
FrozenT [24]

Answer:

I have the same question but a little different I’m sorry that this is useless to you question but it’s not letting me ask my question. Sorry again-

Explanation:

What is a software system designed to locate information on the World Wide Web? Search browser Search engine Search keyword Search results

5 0
3 years ago
Your company's IT management team is looking for an online tool to provide recommendations to save money, improve system availab
alina1380 [7]

Answer:

AWS Trusted Advisor

Explanation:

The IT management team can choose to host their system in Amazon Web Service (AWS) and utilize the AWS Trusted Advisor service to manage the resources. AWS Trusted Advisor is an online tool offered by Amazon to provide guidance to their client to manage the cloud resources by following some recommended good practices. This can save cost, improve system availability and performance and also to improve system security. AWS Trusted Advisor provide recommendation in real time and on regular basis. It will scan a client's subscribed cloud-based infrastructure and provide recommendation actions in five aspects which are cost optimization, performance, security, fault tolerance and service limits.

6 0
3 years ago
What is the name of the method of problem solving that breaks a problem imto smaller problems​
Basile [38]

Answer:

The first thing that came to mind was when my parents tell me "Take it one step at a time" I hope this helps

Explanation:

7 0
2 years ago
Other questions:
  • According to many experts how often should files be backed up
    12·2 answers
  • Write a statement that declares a PrintWriter reference variable named output and initializes it to a reference to a newly creat
    5·1 answer
  • In the given switch statement, what will be displayed if the value of var is 3? switch(var) { case 1: System.out.println("Apple"
    12·1 answer
  • What are the most positive and the most negative decimal numbers that can be represented by a 2C (n+k) bit fixed-point number, w
    12·1 answer
  • What is an example of an attribute for a screen object
    14·1 answer
  • Drag the tiles to the correct boxes to complete the pairs.
    13·1 answer
  • What is another term for additive manufacturing
    7·1 answer
  • Which is the best software application to be used by a hotel manager​
    9·1 answer
  • if you are trying to reduce the cost of college, which of the following strategies is likely to save you the most money?
    9·1 answer
  • You can not give an exact size for a height for column width true or false
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!