Ask Question
12 March, 06:26

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

+4
Answers (1)
  1. 12 March, 06:40
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers