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
Consider the following code example:
vampirchik [111]

Answer:

This exercise includes the following question and options:

What is the logical error in the coded query?

A) <em>The condition in the WHERE clause should be coded in the HAVING clause.</em>

B) <em>The column name for the fifth column in the result set doesn't match the data.</em>

C) <em>The three columns in the ORDER BY clause should use the DESC keyword so the city totals will be in the right sequence.</em>

D) <em>The condition in the HAVING clause should be coded in the WHERE clause.</em>

And from the options provided, the error is in the 5th column, due to the column name in that result series/group doesn't really coincide with the data, thereby the correct option is <em>B)</em>.

3 0
3 years ago
After which problem-solving stage should you take action?
Mumz [18]

Answer:

Option: Making a choice

Explanation:

In a problem solving process, it starts with defining a problem which is the first step that we need to identify the issue.

After that, we should gather the information on the issue that we identify. For example, we are root cause of the problem, what are the possible solutions etc.

Next, we evaluate the information that we collect (e.g. pro and cons of a particular solution).

Next, we make a choice on the solution that we are going to take after further evaluation on all the options we have.

Only after we make a choice, then we can take action based on our chosen solution to solve the problem.

4 0
3 years ago
What precautions should be taken to make a computer more secure ​
Sergeeva-Olga [200]

Answer:

To make a computer more secure

Explanation:

we have following ways :

1)we should have anti virus to protect our computer.

2)we should not play or look computer for a long time because it destroy our files

4 0
3 years ago
How to become a software tester?
HACTEHA [7]
You should look on google to see if there are any websites
5 0
4 years ago
How do I delete a class on Edulastic?
GREYUIT [131]
Class>settings>remove class
hope this helps :3
4 0
4 years ago
Read 2 more answers
Other questions:
  • Discuss how and why video game hardware affects game design and where you think the next generation of platforms will change tho
    9·1 answer
  • A graphic design student is putting the finishing touches on her PowerPoint presentation for her speech. She is carefully analyz
    12·1 answer
  • Does the Main Content (MC) of a web page include searchboxes?
    10·1 answer
  • (15 POINTS) Integrated Circuits Of Made Up Of _____ That Carry The Electrical Current.
    10·1 answer
  • A series circuit contains a generator, two devices, and connecting wires. The resistances of the two devices are 15 ohms and 10
    10·2 answers
  • What is the term used to describe a computer system that can store literary documents, link them according to logical relationsh
    5·1 answer
  • Why are some geo satellites not usually used for transmitting tcp/ip information?
    5·1 answer
  • Write an application program in C++ to implement a class Fibonacci to print Fibonacci series upto N using member function series
    9·1 answer
  • What is fair use?
    15·2 answers
  • Please please help I don’t understand this
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!