Branches, Loops, Arrays (3-5) Flashcards

1
Q

A loop variable update that typically iterates a specific number of times.

A

for loop

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

This kind of loop repeatedly executes the loop body if the loop’s expression evaluates to true.

A

while loop

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

A ___ is a loop that first executes the loop body’s statements, then checks the loop condition. Used when the loop should iterate at least once.

A

do-while loop

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

A decision and its two branches; the decision’s expression is true then the first branch executes, if it is false the second branch executes.

A

if-else statement

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

A ____ is a sequence of statements only executed under a certain condition.

A

branch

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

A decision whose false branch has no statements is often just called an

A

if statement

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

A ___ is a loop that appears in the body of another loop. Can be made up of any loop type such as for, while, do-while.

A

nested loop

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

The two portions of a nested loop are commonly referred to as the…

A

inner loop and outer loop

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

A special variable having one name, but storing a list of data items, with each item being directly accessible.

A

array

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

Each item in an array is known as a(n) ____.

A

Element

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

In an array, each element’s location number is called the ___. Often enclosed in square brackets [ ] and must be an integer.

A

Index

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

What is the index of apple in the follow array?

Apple[?]
Orange[?]
Banana[?]

A

[0]

index starts at 0

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

What is the index of Orange in the follow array?

Apple[?]
Orange[?]
Banana[?]

A

[1]

index starts at 0

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

What is the index of Banana in the follow array?

Apple[?]
Orange[?]
Banana[?]

A

[3]

index starts at 0

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

Each time through a loops statements is called a(n)

A

iteration

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

The difference threshold indicating that floating-point numbers are equal.

A

Epsilon

17
Q

Statement that returns the specified value and immediately exits the function.

A

return statement

18
Q

A word that is part of the language, like integer, Get or Put. These words cannot be used as an identifier.

A

reserved word/keyword