COSC-1337 Chapter 5 Flashcards
What is the first line of a while loop called?
while(condition) {
}
Loop header
Each execution of a loop is known as an?:
Iteration
What is a variable that controls the number of times a loop iterates called?
Loop control variable
What type of loop is the while loop?
It is a “pre-test loop” this is because the condition is tested BEFORE each iteration
What is the “first read” called right before the input is tested by a while loop for input validation?
Priming read
The “++” and “–” operators can only work on what types of values/data?
They can only work with “lvalues” AKA a variable.
What is a “counter”?
It is a variable that increments each time a loop iterates
What is a “sentinel”?
It is a special value or character that is used to mark the end of a list of values
What type of loop terminates when the sentinel is entered?
A “sentinel-controlled loop”
What type of loop is the “do-while loop”?
It is a post-test loop. This means that AFTER each iteration the condition is then tested.
What file header must you include to use “toupper()” and “tolower()”?
cctype
What type of loop is the “for loop”?
It is a pretest loop THAT IS COUNT CONTROLLED
What is a loop inside of another loop called?
A “nested loop”
What is the name for saving data to a file called?
“Writing data” to a file
What is the name of a file that data is “written” to?
Output file