Build a stream summary with three different exits

A stream contains at most 100 representable integer marks, then EOF; a -1 may end processing earlier. Mark 0..100 is accepted. Any other mark except the sentinel is rejected and counted, then processing continues. The sentinel is neither accepted nor rejected, and later tokens are ignored. You may assume all supplied tokens are valid integer representations.

    Write a complete program with no arrays. Print count=K rejected=R average=A with two decimal places; if no mark was accepted, print average=NA instead. Design state variables and state their meanings. Trace 80, 120, 0, -2, 100, -1, 40. Include EOF without a sentinel, immediate sentinel and rejected-only input among your tests.


