"Definite versus Indefinite Loops"

Computer Science
Tutor: None Selected Time limit: 1 Day

Describe one (1) scenario not mentioned in the textbook in which it would be advantageous for you to use a definite loop as opposed to an indefinite loop when developing a program. Provide a rationale for your response.

Nov 4th, 2014

  • In definite loop, the number of iterations is known before we start the execution of the body of the loop.

    Example: repeat for 10 times printing out *.

  • In indefinite loops, the number of iterations is not known before we start to execute the body of the loop, but depends on when a certain condition becomes true (and this depends on what happens in the body of the loop)

    Example: while the user does not decide it is time to stop, print out  * and ask the user whether he wants to stop.


Nov 4th, 2014

Are you studying on the go? Check out our FREE app and post questions on the fly!
Download on the
App Store
...
Nov 4th, 2014
...
Nov 4th, 2014
Dec 6th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer