Westonci.ca is the Q&A platform that connects you with experts who provide accurate and detailed answers. Discover comprehensive answers to your questions from knowledgeable professionals on our user-friendly platform. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

In this lab, you use a counter-controlled while loop in a Python program. When completed, the program should print the numbers 0 through 10, along with their values multiplied by 2 and by 10. The data file contains the necessary variable declarations and output statements. Instructions Make sure the file Multiply.py is selected and opened. Write a counter-controlled while loop that uses the loop control variable (numberCounter) to take on the values 0 through 10. In the body of the loop, multiply the value of the loop control variable by 2 and by 10. Remember to change the value of the loop control variable in the body of the loop. Execute the program by clicking the Run button at the bottom of the screen.

Sagot :

Answer:

In Python:

numberCounter = 0

print("Number\t\tTimes 2\t\tTimes 10")

while numberCounter<=10:

   print(str(numberCounter)+"\t\t"+str(numberCounter*2)+"\t\t"+str(numberCounter*10))

   numberCounter+=1

Explanation:

The required files are not attached to this question. So, the solution I provided is from scratch

This initializes numberCounter to 0

numberCounter = 0

This prints the header

print("Number\t\tTimes 2\t\tTimes 10")

This loop is repeated while numberCounter is not above 10

while numberCounter<=10:

This prints numberCounter along with its product by 2 and 10

   print(str(numberCounter)+"\t\t"+str(numberCounter*2)+"\t\t"+str(numberCounter*10))

   numberCounter+=1

Below is the required Python code for the program.

Python

Program:

head1 = "Number: "

# Multiply by 2

head2 = "Multiplied by 2: "

# Multiply by 10

head3 = "Multiplied by 10: "

# Constant utilized to control loop

NUM_LOOPS = 10

print("0 through 10 multiplied by 2 and by 10" + "\n")

# Initialize loop control variable

x = 0

while(x<11):

# Print the values

   print(head1 + str(x))

   print(head2 + str(x*2))

   print(head3 + str(x*10))

   # Write your counter controlled while loop

   # Next number

   x += 1

Program explanation:

  • Start code.
  • Constant utilized to control loop.
  • Initialize loop control variable.
  • Multiply by 2.
  • Multiply by 10.
  • Write your counter controlled while loop.

Output:

Please find below the attachment of the program output.

Find out more information about Python here:

https://brainly.com/question/26497128

View image Cricetus