Doyle: C#, 5th edition Page 1-1
C# Programming: From Problem Analysis to Program Design, 5th edition
Chapter 13
1. c. InvalidDataFileException
2. b. The DirectoryInfo class also has public properties
6. b. call Close( ) method
7. d. has only static members so to call one of its methods, you must
10 d. add true as the second argument (Append) to the StreamWriter class
11. b. Stream
Doyle: C#, 5th edition Page 1-2
16. e. all of the above
17. d. TextReader
22.
}
23.
Doyle: C#, 5th edition Page 1-3
{
recordData = info.Split(‘|’);
Console.Write(recordData[i]);
Console.WriteLine();
}
}
}
24.
{
{
Doyle: C#, 5th edition Page 1-4
for (int i = 10; i < 50; i++)
fil.Write(“{0} | “, i);
}
}
}
catch (System.Exception exc)
{
Console.WriteLine(exc.Message);
}
public void RetrieveData( )
Doyle: C#, 5th edition Page 1-5
{
{
if ((info = fil.ReadLine()) != null)
{
}
}
}
}
catch (System.IO.IOException exc)
Doyle: C#, 5th edition Page 1-6
{
Console.WriteLine(“I O Problem” + exc.Message);
{
Console.WriteLine(exc.Message);
}
}
25. The files created are using the StreamWriter class are text files and thus are readable.
Binary files are readable by the computer, but not by humans. You cannot simply open and read the