CIS 3309 Section 1
Homework Assignment HWA 07 (Not Assigned Fall 2020)
Abstractions - Files and Graphics and Drawing Surfaces
(Note: Homework should be NEAT and readable! Homework problems are to be turned in to the instructor, not the lab assistant.)
Assignment:
Answer the Following Questions (you may skip
Question number 5 for now):
1. The
StreamReader and
SreamWriter classes
are said to be abstractions of physical entities. What does
this mean?
2. What is the difference between text file and a binary file?
3. In C#, how do we connect a stream abstraction to the actual physical file it models? Write the code.
4.
a. Write a short sequence of C# code which will read an entire file
(stored on C:\MyInput.txt")
all at once
into the string myString and
then closes the file.
b. Assuming the file just read contains all the new terms in your text book
(separated by commas) write the
code that uses the split function to
separate all the terms in the file and store them in an array of tour
choice.
FALL 2018 - You may skip Item #5 below. Later, you may want to come back to it depending on what you choose to do for Project III
5. The following code creates a graphics surface (a Picturebox in this case) on which you can draw. It is followed by code that draws on a Form Control. These two examples illustrate how different graphics elements (lines, rectangles, etc) can be drawn on many different C# controls such as a PictureBox, a Label, a Button or a Form. Based on what you have learned about text files and what you already know about data bases how is it possible that we can use the same methods (some of which are illustrated below) to program on all these different surfaces? How does this work? (The examples are a little long, but you do not have to understand all the details to get the idea.