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
liubo4ka [24]
2 years ago
5

I need help to fill in a few blanks with this coding homework. did some, but need help on the rest. the assignment is down below

Computers and Technology
1 answer:
EleoNora [17]2 years ago
3 0

Answer:

def main():

# Initialize variables

numGuesses = 0

userGuess = -1

secretNum = 5

name = input("Hello! What is your name?")

while ( userGuess != secretNum):

   userGuess = int(input("Guess a number between 1 and 20: "))

   numGuesses = numGuesses + 1

   if (userGuess < secretNum):

        print("You guessed " + str(userGuess) + ". Too low.")

    if (userGuess > secretNum):

         print("You guessed " + str(userGuess) + ". Too high.")

print("You guessed " + str(userGuess) + ". The correct number is " + secretNum + " after " + numGuess + " times.")

main()

Explanation:

add a While until userGuess == secretNum than we stop

You might be interested in
A type of cpu socket, used with modern intel processors, where the cpu itself has no pins but the contact pads of the cpu line u
yawa3891 [41]
<span>A type of cpu socket, used with modern intel processors, where the cpu itself has no pins but the contact pads of the cpu line up with socket pins on the motherboard, is known as LGA.  </span>The Land Grid Array (LGA<span>) is a type of surface-mount packaging for ICs (</span> integrated circuits)<span> that is notable for having the pins on the </span>socket<span> (when a </span>socket is used) rather than the integrated circuit.
3 0
3 years ago
Read 2 more answers
you just bought a new hard drive for your computer .you plan to use this as a secondary hard drive to store alll your files. wha
marin [14]
In case the first drive fails, the data will all be backed up onto the second drive, a copy will still be intact.
7 0
3 years ago
More registers appear to be a good thing, in terms of reducing the total number of memory accesses a program might require. Give
gulaghasi [49]

Answer:

Following is given the answer step by step:

Explanation:

First of all we will write a program using MARIE that will support the statement: Sum = (A + B) - (C + D). All the necessary comments are given in front of each statement:

Load    A                   # variable A will be loaded

Add     B                  # B will be added to A

Store   Temp1         # A + B will be stored in Temp1

Load    C                  # C will be loaded in memory

Add     D                 # D will be added to C

Store   Temp2         # C + D will ge stored in Temp2

Load    Temp1         # Temp1 will be loaded in the memory

Subt     Temp2         # Temp2(A + B) get subtracted from Temp1(A - B)

Store    Sum             # (A + B) - (C + D) will get stored in Sum.

We can see from above program that memory is accessed 9 times. While if C + D get executed first than memory accesses will be reduced to 7.

Above same program could be written using an architecture of 4 registers:

  • R1
  • R2
  • R3
  • R4

The program is as follows:

Load   R1 , A     #A  will be loaded into R1

Load   R2 , B    # B will be loaded into R2

Add     R1 , R2    # R2 gets added to R1 and the result is stored in R1 (A + B)

Load   R3 , C      # C loaded into R3

Load   R4 , D     # D loaded into R4

Add    R3 , R4   # Value in R4 gets added into R3 and R3 becomes (C + D)

                          #no memory accesses required for this operation

Subt   R1 , R4     #R4 (C + D) gets subtracted from R1 (A + B)

                         #no memory accesses required for this operation

Store  Sum        # The recent value will be stored into Sum

Here memory is accessed 5 times in total.

<h2>I hope it will help you!</h2>
8 0
3 years ago
To specify your preferred colors, fonts, and effects for a document, which of the following should be done?
Irina-Kira [14]

Answer: crest custom theme

Explanation:

8 0
2 years ago
Read 2 more answers
Writing anything that comes to mind that may relate to your personal essay is called:
sammy [17]
My life career in computer science
7 0
3 years ago
Read 2 more answers
Other questions:
  • What is the "host" in a typical email address?
    14·1 answer
  • How do you delete a slide from your presentation after selecting it
    8·1 answer
  • Which hardware component is most suspect if a user can barely make out
    10·1 answer
  • A chef writing up her famed recipe for beef stew realizes she has switched parsley and oregano everywhere in the recipe. The che
    13·1 answer
  • Where is the typical location of a touchpad inside of a laptop?
    13·1 answer
  • Obtaining the data of a video file from a flash drive is an example of a(n) _________ operation.
    6·1 answer
  • Your baby brother has found the hammer and is eagerly eyeing one of the boxes. Describe and analyze an algorithm to determine if
    15·1 answer
  • Using a single formatting _______ helps to make reading researched information easier; it lets the reader know what to expect.
    7·1 answer
  • Universal Containers requires that all users add at least one Product Option from the Maintenance Feature to a bundle.
    5·1 answer
  • Which of the following is true about overloaded methods?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!