Write a program that asks the user for their name and how many times to print it. If I enter Bob and 4 it should print:

Bob
Bob
Bob
Bob
Which loop correctly does this?

Group of answer choices

name = input("Enter your name: ")
num = int(input("Enter a positive number: "))

c = 0

while (c > num):
print (name)
c = c + 1

name = input("Enter your name: ")
num = int(input("Enter a number: "))

c = 0

while (c < num):
print(name)
c = c + 1

name = input("Enter your name: ")
num = int (input("Enter a number: "))

c = 1

while (num <= name):
print (name)
c = c + 1

name = input("Enter your name: ")
num = int(input("Enter a number: "))

c = 0

while(c <= num):
print (name)

Answers

Answer 1

Answer:

name = input("Enter your name: ")

num = int(input("Enter a number: "))

c = 0

while c < num:

print(name)

c += 1

Explanation:

This loop correctly prints the user's name for the specified number of times because it starts with c = 0 and continues to print and increment c until it reaches the value of num. The other loops either have incorrect conditions for the while loop to terminate or do not increment c correctly.

Answer 2

The program that asks the user for their name and how many times to print it is in explanation part.

What is programming?

The process of creating a set of instructions that tells a computer how to perform a task is known as programming.

Computer programming languages such as JavaScript, Python, and C++ can be used to create programs.

The loop that correctly prints the user's name the specified number of times is:

name = input("Enter your name: ")

num = int(input("Enter a positive number: "))

c = 0

while (c < num):

   print(name)

   c = c + 1

This loop sets the counter variable c to 0 and then enters a while loop that runs as long as c is less than the number of times the name is printed.

Thus, the program prints the user's name and increments the counter variable by one until the desired number of times is reached within the loop.

For more details regarding programming, visit:

https://brainly.com/question/11023419

#SPJ2


Related Questions

Consider the following code:

for i in range (x, y):
print (i, end=" ")
What values for x and y will output the code below?

10 11 12 13 14 15 16 17 18 19

Group of answer choices

x = 19
y = 9

x = 10
y = 19

x = 10
y = 20

x = 19
y = 10

Answers

Answer:

x = 10

y = 20

Explanation:

The for loop is executed with the loop variable i taking on the values x, x+1, x+2, and so on, up to but not including y.

Since we want to output the numbers from 10 to 19 inclusive, we need to start the loop with x = 10 and end it with y = 20 (not inclusive).

The statement print(i, end=" ") is executed on each iteration of the loop, which prints the value of i followed by a space, without moving to a new line.

So the correct answer is x = 10 and y = 20.

what are some proxy sites for school

Answers

Answer: Something that's not bad.

Explanation: Like maybe school work sites like classroom or docs stuff like that i guess.

What guideline should you use when attaching a document to an email?

A.
make sure the attachment is large enough to send

B.
use shorthand in the title so the title is short

C.
use a descriptive title for the document

D.
use document software that others might not have

Answers

Answer:

C

Explanation:

Option C is the correct answer. By using a descriptive title, the recipient of the email will know what the document contains without having to open it. This will also help the recipient to easily find the document if they need to refer to it later.

Which loop prints the numbers 1, 3, 5, 7, …, 99?\


c = 1

while (c <= 99):
c = c + 2
print(c)

c = 1

while (c < 99):
c = c + 1
print(c)

c = 1

while (c <= 99):
print(c)
c = c + 2

c = 1

while (c < 99):
print(c)
c = c + 1

Answers

The loop that prints the numbers 1, 3, 5, 7, …, 99 is:

The Loop

c = 1

while (c <= 99):

   print(c)

   c = c + 2

This loop initializes the variable c to 1, then enters a while loop that continues as long as c is less than or equal to 99.

During each iteration of the loop, the value of c is printed using the print function, and then c is incremented by 2 using the c = c + 2 statement.

This means that the loop prints out every other odd number between 1 and 99, inclusive.

Read more about loops here:

https://brainly.com/question/19344465

#SPJ1

Other Questions
Rodenstock, Inc. currently places orders for a particular stock item at quarterly intervals. Information concerning this items is as follows: Cost of placing an order P10 Annual demand 20,000 units Purchase price per unit P0.50 The cost of holding the stock items amounts to 20% of the stock value per annum. What annual cost saving would result if Rodenstock used the economic order quantity for order instead of their current policy? a. P 80 b. P 90 c. P150 d. P240 Three species of frogs (A, B and C) look very similar, but in species A and B, the males have courtship songs that sound different from one another. Species C has a song that sounds like species A. Based on this information, what can you assume about whether the frogs live in the same geographic area or different areas? Do you think they are likely closely related, phylogenetically? What function would this difference in song likely serve? jane has a kitten named Fluff-ball. Fluff-ball usually sleeps in a cat bed 20 meters from the kitchen and hardly ever moves. But whenever Jane opens a can of cat food, the kitten comes running into the kitchen as fast as he can. If Fluff-ball takes 5 seconds to reach the kitchen, how fast can he run? Please answer in meters per second. Present at least two paragraphs describing your thoughts about the course. This assignment is worth double points (10 points).Here are some points to help guide your reflections: Your thoughts about the format of the course. Your thoughts about the content. Your thoughts about the assessments. Anything else you would like to add?This course is Music Appreciation (Finance ) A total of k^(10),000 is to be invested. some in bonds and some in certificates of deposit (CDs ). If the amount invested in bonds is to exceed that in certificates of deposits by k^(3),000, how much will be invested in each type of investrient. 1. Which genus or genera of bacteria usually stain positive withthe endospore stain?2. Which genus or genera of bacteria usually stain positive withthe acid-fast stain? A ball is thrown upward with an initial velocity of 75 feet per second and an initial height of 4 feet. Given h(t) = 16t2 + v0t + h0, complete function h to model the vertical motion of the ball. Then find the balls maximum height, to the nearest foot. Explain in your own words as to why creating a portfolio that includes evidence of your skills and abilities important? In the early days after the Holocaust, many survivors faced the problem ofGroup of answer choiceshaving a difficult time finding new places to live.wanting to live in Israel but not being accepted.being forced to move to the country of Poland.wanting to remain in Germany but having to leave. the ratio 20 miunte to 1 hour can be written in the form of 1:n find the value of n Level 2 Problems11. Given the similar triangles at right.Note: Be careful. You do not set upa. The scale factor from small to big isb. y=541562-72C. W=725416248W Question 3 of 10Language uses_____ to quickly express concepts and ideas.O A. lettersB. stringsC. emotionsOD. symbolsSUBMIT What positive behaviors were demonstrated during the discussion you watched? Check all that apply.Participants had read the story in advance and were prepared to discuss it.Participants interrupted each other to get their points across.Participants listened as others spoke.Participants talked about all different topics during the discussion.Participants showed respect for the opinions of others. Phosphorus reacts with chlorine gas to produce phosphorus trichloride:1. Write the chemical equation and balance2. How many moles of chlorine gas are required to produce 17 moles of PCI3 ? 1. Describe the three different type of hemolysis that areobserved on blood agar.2. What is a selective medium?3. What is a differential medium?4. Which media can be used to isolate E. coli sample PLS FIRST PERSON GETS BRAINLLYMatch each plot stage to its description.Match Term DefinitionExposition A) The stage in the plot where the reader is introduced to the characters and the setting.Climax B) The turning point of the story. This is where the protagonist makes a choice or acts to solve the conflict.Falling action C) The protagonist experiences the consequences of the turning point, and the conflict is beginning to be resolved. It leads toward the conclusion of the story.Resolution D) The story is ended. The conflict is resolved, and the life lesson the protagonist learns becomes clear. What is the expression for 20 and 6 Pluto Company sold 2,000 units in October at a price of 535 per unit. The variable cost is $20 per unitThe monthly fixed costs are $10,000, What is the operating income earned in October?A) 30,000B) 70,000C) 20,000D) 40,000 What were some influences that caused language to change from Old English to Middle English to modern English? How is our language today similar and different than Old or Middle English? List the factors of the following numbers. 14, 22, 30, 25,