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 the user guesses correctly?

Answers

Answer 1

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.

secret_code = 1234

user_guess = int(input("Take a guess: "))

while user_guess != secret_code:

    user_guess = int(input("guess again: "))

print("You guessed right")

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

This may or may not be possible with a for loop.


Related Questions

What is a placeholder for a piece of information that can change is called?

Answers

Answer:

Variable.

Explanation:

A placeholder for a piece of information that can change is called variable.

In Computer programming, a variable stores information which is passed from the location of the method call directly to the method that is called by the program.

For example, they can serve as a model for a function; when used as an input, such as for passing a value to a function and when used as an output, such as for retrieving a value from the same function.

Hence, when you create variables in a function, you can can set the values for their parameters.

For instance, to pass a class to a family of classes use the code;

\\parameter Name as Type (Keywords) = value;

\\procedure XorSwap (var a,b :integer) = "myvalue";

An application's certificate indicates the application -
A is regularly updated
B cannot be removed
C is installed
D is authentic

Answers

Answer:

D. is authentic

Explanation:

Authentication can be defined as the process of verifying the identity of an individual or electronic device. Authentication work based on the principle (framework) of matching an incoming request from a user or electronic device to a set of uniquely defined credentials.

Basically, authentication ensures a user is truly who he or she claims to be, as well as confirm that an electronic device is valid through the process of verification.

Biometrics, smart cards, digital certificates, and picture passwords are various methods that can be used to perform an authentication.

Hence, an application's certificate indicates the application is authentic. These certificates are generally referred to as digital certificates.

When an end user installs a software application or program, the computer or mobile device would automatically verify the digital signature contained in the software. If the authentication process is successful, the software would be installed. Else, the installation process would be terminated.

Describe advantages and disadvantages for microprocessor controlled devices in the household.
(4) point form pls

Answers

1.Easier actions 2.Time saving 3.Money saving 4.Energy saving

Explaining AutoCorrect
How is the AutoCorrect feature useful in Outlook 2016? Check all that apply.
It checks for common typing errors.
It can automatically fix the error while you are typing.
It suggests email recipients that might be interested in your message.
It underlines words that need spelling and grammar corrections.
It ensures that you are emailing the correct recipients.

Answers

Answer:

1.

2.

4.

Explanation:

Had the same question

Anyone recommend any underrated kpop songs? I'm mostly into girl group songs, but I'd be nice to listen to a boy group song for once lol.

When I say underrated please don't put songs with more than 30 million streams lol.

Songs I recommend:

Loona/Cherry-Love Cherry Motion
Loona/ViVi-Everyday I Love You
Binu-Bibi
BIYA- COTAI
Luri- Blah Blah
Nature- OOPSIE
Nature- Girls
fromis_9- Heart to Heart
fromis_9- DKDK

There's so much more, buy my brain just stopped working

Answers

Answer:

Omona - Mixnine.

Highlight - Iz*one.

Downpour - IOI.

Goodbye - 2NE1.

Lonely - Sistar.

Stylish - Loona.

Satellite - Loona.

Twilight - Kim Lip.

Explanation:

Answer:

NCT127 /STCKER

Explanation:

Which of the following is true of functions?

Answers

Answer:

their is nothing

Explanation:

functions are true ....

Allows input/output of audio info to and from the computer.

A. Central Processing Unit

B. Sound Card

C. Video Card

D. Audio Player

Answers

Answer:

sound card

.............

QBasic commands any 10 with examples

Answers

Answer:

I haven't used qbasic in a quarter of a century, so my apologies if any of these are outdated.

I listed 13 here as I don't know what are being qualified as "commands" (I'm sure print is in there, but INT? LEN? these might be interpreted not so much as commands as functions)

PRINT prints text on the screen.

PRINT "How much wood would a woodcuhck chuck?"

INPUT gets text from the user

INPUT woodchuckwood$

INT casts a value as an integer

w = INT(woodchuckwood)

OPEN opens a file for input/output

OPEN "woodchuck.consumption" FOR OUTPUT AS #f

OPEN "woodchuck.consumption" FOR INPUT AS #f

CLS clears the screen

CLS

LOCATE specifies the cursor's location on the screen

LOCATE 10, 10

INKEY$ reads a character from the input buffer

a$ = INKEY$

LEN returns the length of a string

l = LEN(a$)

CHR$ takes an int and returns it's ascii value

$enter = CHR$(13)

ASC() returns the ascii value of a character:

$space = ASC(" ")

DO...LOOP repeats a loop until a condition is met:

x = 0

DO

   x = x + 1

LOOP UNTIL x = 10

SHARED declares global values as being accessible locally

SHARED $username

SHELL executes an os command

SHELL "dir /w"

Identify and summarize the features of the Windows 7 backup utility.

Answers

Answer:it is slow

Explanation: slow

Answer:

IT can create a backup it can restore a backup and probably more

Explanation:

which devices is not found in the CPU​

Answers

Plz answer my question

The devices that is not found in the CPU​ is printer. The correct option is D.

What is CPU?

A central processing unit, sometimes known as a CPU, is a piece of electronic equipment that executes commands from software, enabling a computer or other device to carry out its functions.

The part of a computer that obtains and executes instructions is called the central processing unit (CPU).

A CAD system's CPU can be thought of as its brain. It is made up of a control unit, a number of registers, and an arithmetic and logic unit (ALU). The term "processor" is frequently used to refer to the CPU.

The size, speed, sophistication, and price of a printer varies. It is a device that receives text and graphic output from a computer and transmits the information to paper.

Thus, the correct option is D.

For more details regarding CPU, visit:

https://brainly.com/question/16254036

#SPJ6

Your question seems incomplete, the missing options are:

a. ALU

b. Control Unit

c. Instruction register

d. Printer

I need help with this program. I need code for this . Java if statements Determine the amount of discount a person should receive. If the bill is more than 2000, then the person should receive a 15% discount. If the bill is 2000 dollars or less, the person does not receive a discount of any kind. Sample Data: 500 2500 4000 333.33 95874.2154 Sample Output= Enter the original bill amount :: 500 Bill after discount :: 500.00 Enter the original bill amount :: 2500 Bill after discount :: 2125.00 Enter the original bill amount :: 4000 Bill after discount :: 3400.00 Enter the original bill amount :: 333.333 Bill after discount :: 333.33 Enter the original bill amount :: 95874.2154 Bill after discount :: 81493.08

Answers

Answer:

The program in Java is as follows:

import java.util.Scanner;

public class MyClass {

   public static void main(String args[]) {

     double bill;

     Scanner input = new Scanner(System.in);

     System.out.print("Enter the original bill amount : ");

     bill = input.nextDouble();      

     if(bill>2000){

         bill-=0.15*bill;

     }

     System.out.println("Bill after discount: " + bill);

   }

}

Explanation:

This declares bill as double

     double bill;

This lets the program accept input

     Scanner input = new Scanner(System.in);

This prompts user for the original bill amount

     System.out.print("Enter the original bill amount : ");

This gets the bill from the user

     bill = input.nextDouble();      

This checks if the input bill is greater than 2000

     if(bill>2000){

If yes, the bill after discount is calculated as follows:

         bill-=0.15*bill;

     }

This prints the bill after discount

     System.out.println("Bill after discount: " + bill);

Use the drop-down menus to complete the steps to open the Lookup Wizard.

1. Open the table in ___
view.

2. Click in the ___
column of the desired field.

3. Click the ___
, and then click Lookup Wizard.

Answers

Answer: 1. design view 2. data type 3. arrow

Explanation:

I just did it :)

What is the role of the connection medium?

Answers

wth does that mean?!

Review the following definition of sustainable construction projects:
Sustainable construction projects demonstrate common sense applications of natural resources throughout the life of the project.
Sustainable projects also take into account the long-term effects on the environment, including how energy and materials are used and
recycled, which should be incorporated into the building itself.
Based on this definition, which of the following characteristics is not a characteristic of sustainable construction projects?

Energy and material efficiency in construction, operation, and maintenance.

Established technologies that have been in use for several decades

Low environmental impacts over the project's life cycle.

High ratio of renewable energy to fossil energy in construction, operation and maintenance,

Answers

Answer:

Established technologies that have been in use for several decades

Explanation:

Answer:I’m not sure

Explanation:

Drop a paper of A-4 size and a
piece of wood/plastic about 2-3
inches long, from a height more
than 10 feet. Note the time for both
to hit the ground. Now repeat the
experiment by folding the paper
once, twice, thrice... (as many
time as you can). Why every time
the travel time reduces for paper
and remains the same for
wooden/plastic piece. Does the
paper at any stage hit ground
before wooden/plastic piece? If
yes,

Answers

Folding the paper reduces the surface area/volume. Travel time reduces due to less friction.

The wooden or plastic piece never changes its amount of drag/friction in the atmosphere.

If the paper is folded/compressed small enough, such that it’s friction is less than the wood or plastic then yes it would fall faster.

In a perfect vacuum, there is no friction to factor in, thus both fall at same speed.

Which of the following is NOT a peripheral?
Keyboard
USB storage drive
Printer
CPU

Answers

USB is the answer to your question
a CPU is NOT a peripheral device because a computer system cannot work without a CPU.
A peripheral device is used to put information into and get information out of the computer.

Giving 5 stars, a Thanks, 80 points, and Branliest to whoever answers them correctly.
What refers to how a game’s player shapes what happens in their own personal game experience by making choices on how they play?
Group of answer choices

pseudostory

metagame

ludonarrative

iambic pentameter

Answers

Answer:

Explanation:

The answer is ludonarrative.

Please mark me brainliest.

Any device that uses light to read and write information.

A. Optical Drive

B. Peripheral Device

C. Laser Device

D. Optical Device

Answers

Answer:

Optical Storage Device

Drag each label to the correct location. Each label can be used more than once. Match the device to the port through which it connects. Monitor External hard drive Flash drive Flash drive Mouse hdmi usb- c display port thumder port

Answers

Answer:

Mouse - USB

Monitor - display port, HDMI, and thunderbolt port

External hard drive - USB and thunderbolt port

Flash drive - USB

Explanation:

A computer mouse is an input device used to interact with a computer system. It connects with the computer through the USB port.

A Monitor is an output device that is used to display information on a computer system. It can be connected to the system through the display ports, HDMI, and the thunder port.

The External hard drive is a storage device that holds data for a long period of time. It has adapters to connect to the computer through the USB ports or thunderbolt ports. The flash drive is similar in function to the hard drive but small in size and storage space. It only connects with the computer through USB ports.

Answer:

HDMI- Monitor

DisplayPort- Monitor

The other two, I dunno

I need to calculate the % of Grand Total on Microsoft Excel, but can't for the life of me remember how to do that. Help would be greatly appreciated.

PS: Reposting my question because the answers I got previously were both only made for points, not to help in any way. :(

Answers

Answer:

You need to first use the Sum function to add up all the costs of September.

Then divide each September cost by the grand total that you got. After that format the last column to be percentages.

Look at the attached file for the formulas used.

How much mail can be
stored in each mail box?​

Answers

Answer:

Most mailboxes are 1 - 4 GB with one or two larger.

Explanation:

What are the 5 characteristics of flowchart

Answers

Answer:

Here's ur answer

Explanation:

(i) Should consist of standardized and acceptable symbols. (ii) The symbols should be correctly used according to flowcharts rules. (iii) Should have short, clear and readable statements written inside the symbols. (iv) It must have clear one starting point and one ending point.

What allows your computer to communicate over a network and access the Internet?

Answers

Answer:

To connect to the Internet and other computers on a network, a computer must have a NIC (network interface card) installed.

Explanation:

A network cable plugged into the NIC on one end and plugged into a cable modem, DSL modem, router, or switch can allow a computer to access the Internet and connect to other computers. ISPs (Internet service providers)

Android OS "AFTER" Beta.
A. Cupcake
B. Candy
C. Cookie
D. Carmel

Answers

Answer:

Android OS "AFTER" Beta is;

A. Cupcake

Explanation:

The Android Beta mobile operating system was released on November 2007 while on the 23rd of September, 2008, the first commercially available version of the Android, Android 1.0 was released

Android 1.0 and 1.1 were not assigned actual code names and the first Android mobile operating system release to be assigned a code name is the Android 1.5 which was code named Cupcake by the project manager

How did you generate a random number for the user to guess? by using the built-in randint function by using the built-in random function by using the random method from the random module by using the randint method from the random module

Answers

Answer:

by using the randint method from the random module

Explanation:

The randint() method is a method or function in the random python module. It is used to get or return an integer number within a specified range.

To use the method, the module must be imported into the python file with the "import random" statement, then the method is referenced using dot notation and specifying the range of integer numbers.

syntax: random.randint(first_number, last_number)

Note that the last number in the range is inclusive in the selection.

Answer:

A. randint

Explanation:

I got it right on a quiz

How important is the knowledge of ICT to a pupil like you?

Answers

For me it is not important

What do you hope that people see in your digital footprint 5 years from now? ​

Answers

Answer:

I hope they see me playing with my dog (who died a few months ago) Malikeye

Explanation:

none :)

Merle wants to change the formatting of all bold cells to be non-bolded. Shania wants to copy the cell color,
border, and font from cell E12 to all of column D. Which best describes what each person should do?

A. Merle should use Find and Replace, and Shania should use the Format Painter.

B.Merle should use the Rules Manager, and Shania should use Find and Replace.

C.Merle should use the Format Painter, and Shania should use the Rules Manager.

D. Merle should use the Format Painter, and Shania should use Find and Replace.

Answers

Answer:

Merle should use Find and Replace, and Shania should use the Format Painter.

Explanation:

It's the most logical to me.. And that's what I'm gonna do on my test. =) hope it helps.

Three different numbers need to be placed in order from least to greatest. For example, if the numbers are ordered 9, 16, 4, they should be reordered as 4, 9, 16. Which of the following algorithms can be used to place any three numbers in the correct order?

Answers

Answer:

what are the three different numbers?

A small business has been experiencing power outages in their area. When checking the IP-based security camera, they were not able to access the camera. They verified the camera was on and had power. What is MOST likely the problem?

Answers

Group of answer choices.

A. The camera has an invalid gateway address.

B. The camera has been damaged by the power outage.

C. The camera's memory card is full

D. The camera is not connected to the wireless network.

Answer:

D. The camera is not connected to the wireless network.

Explanation:

An IP address is an acronym for internet protocol address and it can be defined as a unique number assigned to a computer or other network devices, so as to differentiate each device from one another in an active network system. Thus, an IP address is typically used to uniquely identify each computer or network devices connected to the internet or network.

In Computer networking, IP address are classified into two (2) main categories and these are;

1. Local (internal) IP address.

2. Global (external) IP address.

In this scenario, a small business has been experiencing power outages in their area. When checking the IP-based security camera, they were not able to access the camera. They verified the camera was on and had power. Thus, what is most likely the problem is that, the camera is not connected to the wireless network.

This ultimately implies that, the IP-based security camera is only powered on but is not interconnected with the other devices on the wireless local area network (WLAN).

Other Questions
I need help with qui est-ce? relationship between sociology and commerce i need help with finding area whats the area of a 3m an 7m regtangle Why did the colonist want a voice in their own affairs?The French advised them to do so.They wanted to start a revolution.They were fed up with British rule.Because King George was such a nice ruler. A phone manufacturer offers its customers two different versions of the same phone. The low storage version costs $350, and the high storage version costs $450. let X represent the manufacturer's income on a randomly chosen purchase of this phone. Based on previous data, here's the probability distribution of X along with summary statistics: Low capacity High capacity income ($) 350 450P(X) 0.65 0.35Mean: x=$385 Standard deviation: x= $48 The manufacturer is considering a $25 price increase on both versions of the phone. Assume that this increase will not change the probability that corresponds to each version. Let Y represent their income on a randomly chosen purchase of this higher priced phone. What are the mean and standard deviation of Y? A pile of wind blown sand is called a A. Delta B. Groin C. Meander D. Dune hey can someone please please please help me asap?! These four historical figures are best known for their contributions to What net force is required to accelerate a car at a rate of 3m/s^2 if the car has a mass of 2,000 kg? I need help....what should my essay be about.......also I am getting s dirtbike what model/brand should I get :) When you have the base currency, what is the operation to do the conversion? heyyy wassup i need help here =v= what is 23 x 2 + 23 x 2 = Can you help? Please :)At Martin Luther King Jr. High School 7 out of 9 students voted to plant trees at the front of the school. A total of 119 voted to plant the trees. How many students voted?A. 153 B. 272C. 128 D. 135 The figure shows a line graph and two shaded triangles that are similar:Which statement about the slope of the line is true? Group of answer choicesA. It is fraction 1 over 2 throughout the line.B. It is 2 throughout the line.C.The slope from point O to point A is fraction 1 over 2 time the slope of the line from point A to point B.D.The slope from point O to point A is two times the slope of the line from point A to point B. 6th grade students were asked what their favorite subject was. 56 students said that math was their favorite subject. If there are 160 6th grade students, what is the percentage of students who chose math as their favorite subject? The application of scientific knowledge to the development and improvement of goods and services is generally referred to as ______. Multiple choice question. technology information production Simplify the following expressions and match them with their solution.a. sec^2x -1 b. 1/sinxc. sinx cotxd. sin^2x/1+cosx How do some people feel the U.S. can promote democracy in Cuba? PLZ ASAP, HELP!!!!!This is from Ninth Ward How is the author using Mama Yaya to reveal something about the plot? (Rising Action) Please use the CER response.