"Definite versus Indefinite Loops"

label Computer Science
account_circle Unassigned
schedule 1 Day
account_balance_wallet $5

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

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
Nov 4th, 2014
...
Nov 4th, 2014
Jun 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