Week 8 (looping) Flashcards

1
Q

what is an example of postfix mode increment/decrement

A

num++, num–

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is an example of pretfix mode increment/decrement

A

–num, ++num;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

syntax of while loop

A

while (condition){
statement;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Is a while loop a pretest or posttest loop?

A

Pretest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a priming read

A

the read in that starts the counter for a loop.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Is a do while a pretest or posttest loop?

A

posttest, will always run at least once.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

is a for loop a pretest or posttest loop?

A

Pretest loop, combined into a single header.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a sentinel value?

A

value not possible like -1 for age

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how to see if you are at the end of a file

A

inputFile.eof()
or
(inputFile&raquo_space; number)
as a boolean expression

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to breakout of a loop?

A

break;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does a continue statement do?

A

stops the current iteration of the loop.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly