Computer Science, asked by siranatyowang, 1 month ago

Explain the differences between the repeat, repeat-until, and wait-until commands.

Answers

Answered by sharmasneh001
1

Answer:

while loops continue on as long as their condition is met. Since wait() always exists, then that condition is met and is true. Therefore the script will loop until that statement is false

Answered by chemistryprogress
0

Explanation:

The loop condition logic and the point of its evaluation.

while loop first evaluates the condition and if it holds, one loop is done, otherwise the looping is done. Then repeat.

repeat…until does one loop and then evaluates the condition. If it doesn’t hold, repeat. If it holds, the looping ends.

This means, for example, that you’ll always do at least one loop with repeat…until, unlike with while which may not do any loops if the condition doesn’t hold upfront.

Also note that some languages have different notions of the repeat…until. E.g. C/C++ used do…while, which also evaluates the condition after the loop, but the looping termination logic is inverted (the same as with while, that is to say positive).

Similar questions