227k views
20 votes
The following loop draws 3 circles on the screen. If I wanted to alter this loop to draw 10 circles, how many lines would my code be?

1 line


3 lines


10 lines


30 lines

User Jshbrmn
by
3.5k points

2 Answers

5 votes

Answer:

3 lines is the answer

Step-by-step explanation:

User Crg
by
3.4k points
3 votes

Answer:

B). 3 lines

Step-by-step explanation:

In order to modify the loop is drawn using three circles to make it drawn employing ten circles, the code must be comprised of three lines. The execution of line 1 includes 3 as the value of x while y remains undefined. Line 2 would employ the same value of x i.e. 3 and the introductory value of y(5 = 3 + 2) where x + 2 is being executed. In the third line, 10 circles can be drawn in total in the loop as {2(previous value) * 5 = 10}, y's updated value.

User Hofshteyn
by
3.0k points