COIS 1520H Lecture 5: WEEK 5 COIS 1520 NOTES
Document Summary
Processing lists of data with do loops. A do loop is a post test loop. Do while is a pre test loop. Be careful to avoid infinite loops- loops that never end. Visual basic allows for the use of either the while keyword or the until keyword. Data to be processed are often retrieved from a file by a do loop. To determine if we have reached the end of the file from which we are reading, we use the peek method. A counter is a numeric variable that keeps track of the number of items that have been processed. An accumulator is a numeric variable that totals numbers. A flag is a variable that keeps track of whether a certain situation has occurred. The data type most suited to flags is boolean. Used when we know how many times we want the loop to execute.