Ask Question
19 October, 14:42

Which of the following represents the number of times the command moveForward () will be executed in the code segment below?

func move (distance:Int) {

for i in 1 ... distance {

moveForward ()

}

}

move (distance:5)

a. 2

b. 4

c. 1

d. 5

+5
Answers (1)
  1. 19 October, 16:31
    0
    The last option is the correct choice.

    Explanation:

    d. 5

    The loop will execute 5 times.

    Best Regards!
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which of the following represents the number of times the command moveForward () will be executed in the code segment below? func move ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers