Chapter 6 Flashcards

1
Q

What is a iteration?

A

one execution of a loop

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

What is a definitive loop?

A
  • Also called counted loop
  • Programmer knows exact number of iterations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a indefinite loop?

A
  • Programmer cannot predict number of iterations
  • Event controlled loop
  • Altered by user input
  • Controlled by by the user
  • Executed any number of times
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When do you need curly braces?

A

When you have more then one statement

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

How is data validated?

A
  • Ensuring a value falls within a specified range
  • Use indefinite loops to validate input data
  • If a user enters incorrect data, the loop repeats
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a priming read?

A
  • Input retrieved before the loop is entered
  • Within a loop, the last statement retrieves the next input value and checks the value before the next entrance of the loop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When do you use the prefix or postfix incriment operator?

A
  • Use only with variables
  • Unary operators
  • Use with one value
  • Increase a variables value by 1
  • No difference between operators (unless other operators are in the same expression)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does prefix++ calculate?

A
  • The result is calculated and stored
  • Then the variable is used
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How is postfix++ calculated?

A
  • The variable is used
  • Then the result is calculated and stored
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a pretest loop?

A

loop in which the variable is tested before the loop body executes

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

What is a postest loop?

A

loop in which the variable is tested after the loop body executes

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