Week 8 (looping) Flashcards
what is an example of postfix mode increment/decrement
num++, num–
what is an example of pretfix mode increment/decrement
–num, ++num;
syntax of while loop
while (condition){
statement;
}
Is a while loop a pretest or posttest loop?
Pretest
What is a priming read
the read in that starts the counter for a loop.
Is a do while a pretest or posttest loop?
posttest, will always run at least once.
is a for loop a pretest or posttest loop?
Pretest loop, combined into a single header.
What is a sentinel value?
value not possible like -1 for age
how to see if you are at the end of a file
inputFile.eof()
or
(inputFile»_space; number)
as a boolean expression
How to breakout of a loop?
break;
What does a continue statement do?
stops the current iteration of the loop.