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)
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.
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