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)
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.
Home » Computers & Technology » 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