Week of April 10, 2016

Topics for this week: Streams and File I/O

Activity checklist
  Read chapter 13 in your course packet
  Review the slides File I/O
  Complete lab #25. It is due by 11:59pm on Tuesday.
  Complete lab #26. It is due by 11:59pm on Thursday.
  Complete project #11. It is due by 11:59pm on Sunday.
  Study the code example here that illustrates some important concepts in file I/O.

It is expected that you will meet the objectives outlined here by the end of the week. You might want to test yourself to see how well you fare. You can be guaranteed that you will be tested on these concepts on your next exam. By the end of this unit, you should be able to:

Reading assignment

All reading should be done before you come to class.

  1. Chapter 14 in the course packet discusses the C# stream classes that are used for file I/O.
  2. Streams and File I/O - we will go over these slides in class. One of the major topics in this set of slides is how we handle error situations when reading and writing files.

important concepts

You should be sure that you understand the following important ideas about streams and file I/O:

  1. A stream is a sequential set of data. We read from Input Streams and we write to Output Streams.
  2. To read from a file, you need an object of the StreamReader class.
  3. To write to a file, you need an object of the StreamWriter class.
  4. In C#, data can be stored in a file either as text data (ordinary unicode characters), or as binary data. Binary data is stored on disk exactly as it is stored in the computer's memory.

Lab Assignment
This week you should complete labs 25 and 26. These lab will give you some practice dealing with file I/O issues.

Be sure that you include the declaration that you did not copy any code in all of your source code files. If this statement does not appear in your program, it will not be graded.