Ask Question
7 September, 04:41

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

+3
Answers (1)
  1. 7 September, 08:20
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers