82.4k views
0 votes
n the case of the sentinel-controlled while loop, the first item is read before the while loop is entered. True False

1 Answer

2 votes

Answer:

True

Step-by-step explanation:

Sentinel-controlled repetition is often called indefinite repetition because the number of repetitions is not known before the loop begins executing. A sentinel value must be chosen that cannot be confused with an acceptable input value.

The pseudocode for a sentinel-controlled while loop look like this:

  • Prompt the user to enter the first input
  • Input the first value (possibly the sentinel)
  • While the user has not yet entered the sentinel
  • Execute some statement block
  • Prompt the user to enter the next grade
  • Input the next grade (possibly the sentinel)
User SiggiSv
by
4.7k points