Question
Using "while" loops:

Discuss the purpose of a priming read. Discuss the purpose of a sentinel value. Discuss the potential usefulness of the Java break, continue, and return branch- ing statements when coding loops.
Discuss in beginner level in your own words.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Priming read is for reading first input. This is used for having a proper condition for while loop termination when number of while looop iteration depends on first entry read.

Sentinal value are requried to terminate a while loop when end of input is not known and is based on user inputing a sentinal value.

break is used to break out of the while loop based on some condition matching before all iterations are done.

continue is used when on special condition rest of the loop statement need not run for current data values

return is used generally within function when end result of fucntion is known and no other statement in loop or outside loop are needed to be evaluated.

Add a comment
Know the answer?
Add Answer to:
Using "while" loops: Discuss in beginner level in your own words. Discuss the purpose of a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT