Loop Situation 3

Finally, consider situation (3) where the number of marks to be entered is not known. In this case it is necessary to include a DUMMY mark after the final actual mark to indicate that the data has come to an end. This DUMMY should have a value, which cannot occur naturally in the actual marks since it will be used to terminate the loop. This DUMMY item of data, which indicates the end of a list of true data is known as a SENTINEL. A possible SENTINEL in this example might be -1 since it would not occur as a normal exam mark.

Loop Situation 3 Option 1