UNIT 4 Flashcards

1
Q

What is a indeterminate loop

A

A loop that has no defined amount of iterations. It will run until the condition is satisfied.

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

What is a determinate loop

A

It’s a loop that has a set amount of iterations. You will know how many times it will loop at compile time.

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

What is the LCC?

A

Loop Continuation Condition. This is the evaluation done at every loop to verify if true of false

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

What is the minimum amount of iterations for a do-while loop

A

1

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

What kind of loop do you use for a determinate loop

A

You should use:
- for loop
- Counter-Controller while loop

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

What kind of loop do you use for an indeterminate loop

A

You should use:
- while
- do-while loop

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

what are the paranthese in the for loop declaration

A

It’s called the loop declaration header

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

What are the three expressions in the loop declaration header

A

Expression 1: Declares the loop control variable or the loop counter
Expression 2: Loop Continuation Condition Expression
Expression 3: Loop Counter adjustment Expression. It’s the last action performed done in the iteration of the body code

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

What keyword do you use to exit a loop

A

break;

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

What does the continue keyword do?

A

It will stop further execution and return to the top of the loop

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

How do we create a file object

A

File myFile = new File(“DataFile1.txt”);

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

How do you setup a Scanner to read a File

A

Scanner fileScanner = new Scanner(fileObeject);

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

What is an absolute path

A

It’s a direct path location to the file. It include the drive location

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

What is a relative path

A

It’s the path to the file relative to the execution location of the program

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

What method of object do you use to see if the file is on the drive

A

exists()

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

What is an exception?

A

It’s an object that is created by the JVM to signal that something has gone wrong

17
Q

What is an unchecked Exception

A

It’s an exception that is not handled when thrown. There is no additional code to handle it

18
Q

What is a checked exception

A

It’s an exception that has a handled case. It will try to handle the exception thrown by the JVM