UNIT 4 Flashcards
What is a indeterminate loop
A loop that has no defined amount of iterations. It will run until the condition is satisfied.
What is a determinate loop
It’s a loop that has a set amount of iterations. You will know how many times it will loop at compile time.
What is the LCC?
Loop Continuation Condition. This is the evaluation done at every loop to verify if true of false
What is the minimum amount of iterations for a do-while loop
1
What kind of loop do you use for a determinate loop
You should use:
- for loop
- Counter-Controller while loop
What kind of loop do you use for an indeterminate loop
You should use:
- while
- do-while loop
what are the paranthese in the for loop declaration
It’s called the loop declaration header
What are the three expressions in the loop declaration header
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
What keyword do you use to exit a loop
break;
What does the continue keyword do?
It will stop further execution and return to the top of the loop
How do we create a file object
File myFile = new File(“DataFile1.txt”);
How do you setup a Scanner to read a File
Scanner fileScanner = new Scanner(fileObeject);
What is an absolute path
It’s a direct path location to the file. It include the drive location
What is a relative path
It’s the path to the file relative to the execution location of the program
What method of object do you use to see if the file is on the drive
exists()