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
2 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]2 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
Which type of element is , and what is the meaning of that element?
IrinaK [193]

Answer:

1. Semantic

2. modifies

Explanation:

Semantic HTML is understood by the traditional browser, and semantic tags are the one that ensures not just presentation, but also adds the meaning to the webpage. And hence, img here is both semantic as well as presentational. Hence, the first option is semantic. And the IMG modifies the meaning of the web page. The description is done by the text. And hence the second option is modified.

.

6 0
2 years ago
If you wanted to create a line of code that would add ten to the user’s current score, which code should you use?
Korvikt [17]

Answer:

choice c

Explanation:

score = score + 10

because the rest doesn't make since and score == score + 10 has an extra equal sign.

7 0
3 years ago
Read 2 more answers
What does the following code output? System.out.println((5+20 + 5)<br> * (10 / 10))
shepuryov [24]

Explanation:

the output of your code is 30

8 0
3 years ago
What are two fundamental components of data structures?
Fed [463]
Organization and access method.

Hope this helped! :)

- Jujufire
8 0
3 years ago
(25 POINTS)Which statement best reflects the importance of following safety guidelines?
jeyben [28]

Answer:

I think, Every year, thousands of people die as a result of workplace injuries.

6 0
3 years ago
Read 2 more answers
Other questions:
  • What is computer virus?
    8·1 answer
  • A collection of information stored in an electronic format that can be searched by a computer.
    14·1 answer
  • Which option marks all modification made within a document? Review Comment Track Changes Balloons
    15·2 answers
  • You start up your laptop while getting a coffee across the room. You hear the usual chimes and doinks as it starts up. When you
    14·2 answers
  • Of the following online activities, identify the TWO that are most likely to be affected by bandwidth quality
    11·1 answer
  • Research and build a chroot jail that isolates ssh users who belong to the restrictssh group. (You will also need to create the
    9·1 answer
  • The technique helps you explore possible risks by providing access to risk areas identified in the past. It also provides the so
    10·1 answer
  • How you use ict today and how will you use it tomorrow
    14·1 answer
  • What maintains data about various types of objects, events, people, and places?
    10·1 answer
  • a) consider the binary number 11010010. what is the base-4 representation of (11010010)2? (there is a way to do this without con
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!