"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

Studypool's Notebank makes it easy to buy and sell old notes, study guides, reviews, etc.
Click to visit
The Notebank
...
Nov 4th, 2014
...
Nov 4th, 2014
Mar 28th, 2017
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