Course Hero Logo

Lesson_6 Reading & Notes.docx - 4.4 File Input and Output...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 2 out of 2 pages.

4.4 File Input and Output (11)4.5 Input Failure (2)6.3 Loops Using the While Statement – from “End-of-File-Controlled Loops” onAfter a program has read the last piece of data from an input file, the computer is at the end of the file.Sentinel-Controlled Loops: the program read data until it encounters the sentinel value.EOF-Controlled Loops: it reads data until it reaches the end of the file.Flag-Controlled Loops: a flag is a Boolean variable that is used to control the logical flow of a program. That is, we can seta Boolean variable to Truebefore a While loop; then when we want to stop executing the loop, we can reset it to False.Looping Subtasks: counting, summing, and keeping track of a previous value.
End of preview. Want to read all 2 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Winter
Professor
N/A
Tags
Control flow, End of File Controlled Loops

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture