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
Maslowich
3 years ago
14

What kind of loop should be used in a game where the user is guessing a secret code and the message"guess again" appears until t

he user guesses correctly?
Computers and Technology
1 answer:
GenaCL600 [577]3 years ago
3 0

Answer:

While loop

Explanation:

It should be noted that the number of times which the computer will ask the user to take a guess is not known.

When we have a condition like this, the while loop (or in some programs; the do-while loop) is to be used.

To further back my point, see the following program in python.

<em>secret_code = 1234</em>

<em>user_guess = int(input("Take a guess: "))</em>

<em>while user_guess != secret_code:</em>

<em>     user_guess = int(input("guess again: "))</em>

<em>print("You guessed right")</em>

<em />

The above program will keep asking the user to take a guess until the user enters 1234.

<em>This may or may not be possible with a for loop.</em>

You might be interested in
Find the area of square whose perimeter is 260.8m​
inessss [21]
4251.04

The perimeter (260.8) over 4 is equal to each side length (65.2)

65.2^2 = 4251.04
5 0
2 years ago
How to tell if screen or screen protector is cracked?
beks73 [17]
You will feel the screen protector crack
6 0
3 years ago
Read 2 more answers
What are the data types in access​
Julli [10]

Answer:

Data type in Microsoft Access Database

Text  

Memo  

Byte  

Integer

Long  

Single  

Double  

Currency  

AutoNumber  

Date/Time  

Yes/No  

Ole Object  

Hyperlink  

Lookup Wizard

Explanation:

4 0
3 years ago
Effective nonverbal communication can cause tension.<br><br> True or False
agasfer [191]

Explanation:

When your nonverbal signals match up with the words you're saying, they increase trust, clarity, and rapport. When they don't, they can generate tension, mistrust, and confusion.

4 0
3 years ago
There are three required elements needed to connect to the internet: hardware, web browser, and __________.
malfutka [58]

Yes the answer is D.internet service.

7 0
3 years ago
Read 2 more answers
Other questions:
  • The layout button is located in the ____ group on the home tab?
    14·1 answer
  • 2. Now write a program named filereader.py that reads and displays the data in friends.txt. This program should also determine a
    5·1 answer
  • What command limits structural changes, such as adding, deleting, or moving sheets, that can be made in a workbook?
    13·1 answer
  • How we can get NET I'D by IP Address?
    11·1 answer
  • Unemployment can be viewed as
    14·1 answer
  • Which finger presses the Shift key on the keyboard?
    6·2 answers
  • Teenagers and their parents will never understand each other-the generation gap is too big. Its for my grade 11 English speech​
    10·2 answers
  • An instruction for the computer. Many commands put together to
    5·1 answer
  • How to add links in HTML? ​
    8·1 answer
  • The standard naming convention prefix tag for a query used to identify the object type is?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!